diff options
author | Bernhard Schommer <bschommer@users.noreply.github.com> | 2018-08-20 11:09:33 +0200 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2018-08-20 11:09:33 +0200 |
commit | 939977c7142222d0ec0b67322b06daa187a7b829 (patch) | |
tree | 78fa95dbe10be83c51df063999695f7ea62e681d /cparser/Diagnostics.ml | |
parent | b9a6a50546222269bb9445d0d21d948028b2720a (diff) | |
download | compcert-939977c7142222d0ec0b67322b06daa187a7b829.tar.gz compcert-939977c7142222d0ec0b67322b06daa187a7b829.zip |
Added warning for incomplete tentative static defs (#114)
Tentative static definitions with incomplete type are not allowed
in C99. However most popular compilers support them and warn
about them.
Bug 23377
Diffstat (limited to 'cparser/Diagnostics.ml')
-rw-r--r-- | cparser/Diagnostics.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cparser/Diagnostics.ml b/cparser/Diagnostics.ml index 52e5e456..0987068e 100644 --- a/cparser/Diagnostics.ml +++ b/cparser/Diagnostics.ml @@ -96,6 +96,7 @@ type warning_type = | Extern_after_definition | Static_in_inline | Flexible_array_extensions + | Tentative_incomplete_static (* List of active warnings *) let active_warnings: warning_type list ref = ref [ @@ -155,6 +156,7 @@ let string_of_warning = function | Extern_after_definition -> "extern-after-definition" | Static_in_inline -> "static-in-inline" | Flexible_array_extensions -> "flexible-array-extensions" + | Tentative_incomplete_static -> "tentative-incomplete-static" (* Activate the given warning *) let activate_warning w () = @@ -206,6 +208,7 @@ let wall () = Extern_after_definition; Static_in_inline; Flexible_array_extensions; + Tentative_incomplete_static; ] let wnothing () = @@ -241,6 +244,7 @@ let werror () = Extern_after_definition; Static_in_inline; Flexible_array_extensions; + Tentative_incomplete_static; ] (* Generate the warning key for the message *) @@ -423,6 +427,7 @@ let warning_options = error_option Extern_after_definition @ error_option Static_in_inline @ error_option Flexible_array_extensions @ + error_option Tentative_incomplete_static @ [Exact ("-Wfatal-errors"), Set error_fatal; Exact ("-fdiagnostics-color"), Ignore; (* Either output supports it or no color *) Exact ("-fno-diagnostics-color"), Unset color_diagnostics; |