linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] predefine: add a macro telling about named address spaces
@ 2020-06-16  0:50 Luc Van Oostenryck
  2020-06-16 19:13 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Luc Van Oostenryck @ 2020-06-16  0:50 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

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@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-16 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  0:50 [PATCH] predefine: add a macro telling about named address spaces Luc Van Oostenryck
2020-06-16 19:13 ` Linus Torvalds
2020-06-16 20:51   ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).