From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] preprocess: use predefine() also for __%s__TYPE__
Date: Mon, 29 Jun 2020 21:20:47 +0200 [thread overview]
Message-ID: <20200629192047.92114-1-luc.vanoostenryck@gmail.com> (raw)
Most predefined macros are created by predefine() which
avoid the 'write then parse' done with add_pre_buffer() but
those defined by predefined_type() did not.
So, convert predefine_type() to use predefine().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
lib.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib.c b/lib.c
index e56788260cb7..d8fbe8b1a006 100644
--- a/lib.c
+++ b/lib.c
@@ -1274,7 +1274,10 @@ static void predefined_min(const char *name, struct symbol *type)
static void predefined_type(const char *name, struct symbol *type)
{
const char *typename = builtin_typename(type);
- add_pre_buffer("#weak_define __%s_TYPE__ %s\n", name, typename);
+ char buf[32];
+
+ snprintf(buf, sizeof(buf), "__%s_TYPE__", name);
+ predefine(buf, 1, typename);
}
static void predefined_ctype(const char *name, struct symbol *type, int flags)
--
2.27.0
reply other threads:[~2020-06-29 19:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200629192047.92114-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).