aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Diagnostics.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2018-05-07 20:09:54 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-05-26 11:05:13 +0200
commit2b2585f39000f7000f296bc5b35c14e70f0c31fe (patch)
treef7b8f8a520d65af2fb7bc94332e7760bae1eb032 /cparser/Diagnostics.ml
parent3de896cebebbdb35d179d17133ee53e505b1f0a8 (diff)
downloadcompcert-kvx-2b2585f39000f7000f296bc5b35c14e70f0c31fe.tar.gz
compcert-kvx-2b2585f39000f7000f296bc5b35c14e70f0c31fe.zip
Warning for extern declaration after definition.
Warning for change of storage class after the definition of a function from default storage class to extern storage class. This only plays a role if the function is also declared inline, since for inline functions with default storage class no code is generated, but for inline functions with extern storage class code should be generated. Bug 23512
Diffstat (limited to 'cparser/Diagnostics.ml')
-rw-r--r--cparser/Diagnostics.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/cparser/Diagnostics.ml b/cparser/Diagnostics.ml
index d014921a..91acd161 100644
--- a/cparser/Diagnostics.ml
+++ b/cparser/Diagnostics.ml
@@ -93,6 +93,7 @@ type warning_type =
| Wrong_ais_parameter
| Unused_ais_parameter
| Ignored_attributes
+ | Extern_after_definition
(* List of active warnings *)
let active_warnings: warning_type list ref = ref [
@@ -116,6 +117,7 @@ let active_warnings: warning_type list ref = ref [
Wrong_ais_parameter;
Unused_ais_parameter;
Ignored_attributes;
+ Extern_after_definition;
]
(* List of errors treated as warning *)
@@ -148,6 +150,7 @@ let string_of_warning = function
| Wrong_ais_parameter -> "wrong-ais-parameter"
| Unused_ais_parameter -> "unused-ais-parameter"
| Ignored_attributes -> "ignored-attributes"
+ | Extern_after_definition -> "extern-after-definition"
(* Activate the given warning *)
let activate_warning w () =
@@ -196,6 +199,7 @@ let wall () =
Unused_parameter;
Wrong_ais_parameter;
Ignored_attributes;
+ Extern_after_definition;
]
let wnothing () =
@@ -228,6 +232,7 @@ let werror () =
Wrong_ais_parameter;
Unused_ais_parameter;
Ignored_attributes;
+ Extern_after_definition;
]
(* Generate the warning key for the message *)
@@ -407,6 +412,7 @@ let warning_options =
error_option Wrong_ais_parameter @
error_option Unused_ais_parameter @
error_option Ignored_attributes @
+ error_option Extern_after_definition @
[Exact ("-Wfatal-errors"), Set error_fatal;
Exact ("-fdiagnostics-color"), Ignore; (* Either output supports it or no color *)
Exact ("-fno-diagnostics-color"), Unset color_diagnostics;