aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Diagnostics.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2018-05-07 17:21:55 +0200
committerGitHub <noreply@github.com>2018-05-07 17:21:55 +0200
commite2c2f22be7e4df4ceb9a4c7e6c1695d0aeef7865 (patch)
tree6ba8c18b1de5983363826645eed123aca5702220 /cparser/Diagnostics.ml
parent6657ff7f757d22ad70fe13458f8e7eb76698ac6b (diff)
downloadcompcert-kvx-e2c2f22be7e4df4ceb9a4c7e6c1695d0aeef7865.tar.gz
compcert-kvx-e2c2f22be7e4df4ceb9a4c7e6c1695d0aeef7865.zip
Added a diagnostic for attributes dec after def
The new warning is raise for function declaration after a function definition that introduce new attributes, which are ignored. Bug 23385
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 f18d1b2d..d014921a 100644
--- a/cparser/Diagnostics.ml
+++ b/cparser/Diagnostics.ml
@@ -92,6 +92,7 @@ type warning_type =
| Unused_parameter
| Wrong_ais_parameter
| Unused_ais_parameter
+ | Ignored_attributes
(* List of active warnings *)
let active_warnings: warning_type list ref = ref [
@@ -114,6 +115,7 @@ let active_warnings: warning_type list ref = ref [
Inline_asm_sdump;
Wrong_ais_parameter;
Unused_ais_parameter;
+ Ignored_attributes;
]
(* List of errors treated as warning *)
@@ -145,6 +147,7 @@ let string_of_warning = function
| Unused_parameter -> "unused-parameter"
| Wrong_ais_parameter -> "wrong-ais-parameter"
| Unused_ais_parameter -> "unused-ais-parameter"
+ | Ignored_attributes -> "ignored-attributes"
(* Activate the given warning *)
let activate_warning w () =
@@ -192,6 +195,7 @@ let wall () =
Unused_variable;
Unused_parameter;
Wrong_ais_parameter;
+ Ignored_attributes;
]
let wnothing () =
@@ -223,6 +227,7 @@ let werror () =
Unused_variable;
Wrong_ais_parameter;
Unused_ais_parameter;
+ Ignored_attributes;
]
(* Generate the warning key for the message *)
@@ -401,6 +406,7 @@ let warning_options =
error_option Unused_parameter @
error_option Wrong_ais_parameter @
error_option Unused_ais_parameter @
+ error_option Ignored_attributes @
[Exact ("-Wfatal-errors"), Set error_fatal;
Exact ("-fdiagnostics-color"), Ignore; (* Either output supports it or no color *)
Exact ("-fno-diagnostics-color"), Unset color_diagnostics;