Skip to contentSkip to conversation

Add -Wno-address-space

PATCH RESEND New Josh Triplett 1 participant 1 message Aug 30, 2006 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/3 Add -Wno-address-space

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.

---
 evaluate.c |    2 +-
 lib.c      |    2 ++
 lib.h      |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)
evaluate.c +1 -1
index 2561f38..c5d2526 100644
@@ -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 */
lib.c +2 -0
index feb755a..61c35b3 100644
@@ -178,6 +178,7 @@ int Wcast_to_address_space = 0;
 int Wdecl = 0;
 int Wtransparent_union = 1;
 int Wshadow = 0;
+int Waddress_space = 1;
 int preprocess_only;
 char *include;
 int include_fd = -1;
@@ -323,6 +324,7 @@ static const struct warning {
 	{ "context", &Wcontext },
 	{ "transparent-union", &Wtransparent_union },
 	{ "shadow", &Wshadow },
+	{ "address-space", &Waddress_space },
 };
 
 
lib.h +1 -0
index a248c08..24dd38f 100644
@@ -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;
Signature · 1 line
1.4.1.1