From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] predefine: add a macro telling about named address spaces
Date: Tue, 16 Jun 2020 02:50:12 +0200 [thread overview]
Message-ID: <20200616005012.66141-1-luc.vanoostenryck@gmail.com> (raw)
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
next reply other threads:[~2020-06-16 0:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 0:50 Luc Van Oostenryck [this message]
2020-06-16 19:13 ` [PATCH] predefine: add a macro telling about named address spaces Linus Torvalds
2020-06-16 20:51 ` Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616005012.66141-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).