Add -Wno-enum-mismatch
PATCH RESEND 2/3 Add -Wno-enum-mismatch
Add the ability to turn off enum type mismatch warnings using -Wno-enum-mismatch, helpful when attempting to track down a particular class of warnings only without losing them amongst others. Enum type mismatch checking defaults to on, so this does not change the default behavior of sparse.
Signed-off-by Josh Triplett <[email protected]>
--- evaluate.c | 2 ++ lib.c | 2 ++ lib.h | 1 + 3 files changed, 5 insertions(+), 0 deletions(-)
evaluate.c +2 -0
@@ -243,6 +243,8 @@ warn_for_different_enum_types (struct po struct symbol *typea, struct symbol *typeb) { +if (!Wenum_mismatch) +return ;if (typea->type ==SYM_NODE ) typea = typea->ctype.base_type;if (typeb->type ==SYM_NODE )
lib.c +2 -0
@@ -179,6 +179,7 @@ int Wdecl = 0;int Wtransparent_union =1 ;int Wshadow =0 ;int Waddress_space =1 ; +int Wenum_mismatch =1 ;int preprocess_only;char *include;int include_fd =-1 ;
@@ -325,6 +326,7 @@ static const struct warning { { "transparent-union", &Wtransparent_union }, { "shadow", &Wshadow }, { "address-space", &Waddress_space }, + { "enum-mismatch", &Wenum_mismatch }, };
lib.h +1 -0
@@ -79,6 +79,7 @@ extern int Wbitwise, Wtypesign, Wcontextextern int Wtransparent_union;extern int Waddress_space;extern int Wcast_to_address_space; +extern int Wenum_mismatch;extern int Wdecl;extern int Wone_bit_signed_bitfield;extern int Wshadow;
Signature · 1 line
1.4.1.1