[PATCH] predefine: add a macro telling about named address spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sparse supports named address spaces since v0.6.0-rc1.
This gives much nicer warnings ('... __user' instead of '... <asn:1>')
but this featres is not yet used in the kernel since it could be
a problem for people using an older version of Sparse.

So, add a define which can be used to check if named address spaces
are supported or not.

I should have done this a long time ago!

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib.c b/lib.c
index 951d400ea2fa..ebbcd3b150aa 100644
--- a/lib.c
+++ b/lib.c
@@ -1295,6 +1295,7 @@ static void predefined_ctype(const char *name, struct symbol *type, int flags)
 static void predefined_macros(void)
 {
 	predefine("__CHECKER__", 0, "1");
+	predefine("__SPARSE_HAS_NAMED_ADDRESS_SPACE__", 0, "1");
 	predefine("__GNUC__", 1, "%d", gcc_major);
 	predefine("__GNUC_MINOR__", 1, "%d", gcc_minor);
 	predefine("__GNUC_PATCHLEVEL__", 1, "%d", gcc_patchlevel);
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux