diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-17 06:50:10 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-02 18:42:06 +0200 |
commit | 763d239e13f9298d32dd34dc5a58b0cf6360f32a (patch) | |
tree | f89969f0c21977b88238871db78ffc74b453155a | |
parent | 626e61ab54cd77666976f8c66c705a9012d2984c (diff) | |
download | sparse-763d239e13f9298d32dd34dc5a58b0cf6360f32a.tar.gz |
options: make Wsparse_error less special
-Wsparse-error should not be enabled with -Wsparse-all, this is
special cased in the condition in loop handling -Wsparse-all.
However, the condition already handle warnings forced to off.
So instead of explicitly checking for &Wsparse_error, it's enough
to force Wsparse_error off.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -276,7 +276,6 @@ int Winit_cstring = 0; int Wint_to_pointer_cast = 1; int Wenum_mismatch = 1; int Wexternal_function_has_definition = 1; -int Wsparse_error = 0; int Wmemcpy_max_count = 1; int Wnewline_eof = 1; int Wnon_pointer_null = 1; @@ -296,6 +295,7 @@ int Wshadow = 0; int Wshift_count_negative = 1; int Wshift_count_overflow = 1; int Wsizeof_bool = 0; +int Wsparse_error = WARNING_FORCE_OFF; int Wstrict_prototypes = 1; int Wtautological_compare = 0; int Wtransparent_union = 0; @@ -793,7 +793,7 @@ static char **handle_switch_W(char *arg, char **next) if (!strcmp(arg, "Wsparse-all")) { int i; for (i = 0; warnings[i].name; i++) { - if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Wsparse_error) + if (*warnings[i].flag != WARNING_FORCE_OFF) *warnings[i].flag = WARNING_ON; } } |