Add the ability to turn off address-space mismatch warnings using -Wno-address-space, helpful when attempting to track down a particular class of warnings only without losing them amongst others. Address space checking defaults to on, so this does not change the default behavior of sparse. Signed-off-by: Josh Triplett <josh@xxxxxxxxxxxxxxx> --- evaluate.c | 2 +- lib.c | 2 ++ lib.h | 1 + 3 files changed, 4 insertions(+), 1 deletions(-) diff --git a/evaluate.c b/evaluate.c index 2561f38..c5d2526 100644 --- a/evaluate.c +++ b/evaluate.c @@ -681,7 +681,7 @@ const char * type_difference(struct symb return "different base types"; /* Must be same address space to be comparable */ - if (as1 != as2) + if (Waddress_space && as1 != as2) return "different address spaces"; /* Ignore differences in storage types or addressability */ diff --git a/lib.c b/lib.c index ad19696..84d0647 100644 --- a/lib.c +++ b/lib.c @@ -177,6 +177,7 @@ int Wptr_subtraction_blows = 0; int Wcast_to_address_space = 0; int Wdecl = 0; int Wtransparent_union = 1; +int Waddress_space = 1; int preprocess_only; char *include; int include_fd = -1; @@ -321,6 +322,7 @@ static const struct warning { { "typesign", &Wtypesign }, { "context", &Wcontext }, { "transparent-union", &Wtransparent_union }, + { "address-space", &Waddress_space }, }; diff --git a/lib.h b/lib.h index a61b2dd..e6b9bfa 100644 --- a/lib.h +++ b/lib.h @@ -77,6 +77,7 @@ extern int Wdefault_bitfield_sign; extern int Wundefined_preprocessor; extern int Wbitwise, Wtypesign, Wcontext; extern int Wtransparent_union; +extern int Waddress_space; extern int Wcast_to_address_space; extern int Wdecl; extern int Wone_bit_signed_bitfield; - To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html