From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Christopher Li <sparse@chrisli.org>
Subject: [PATCH 1/7] teach sparse about -Waddress
Date: Wed, 22 Mar 2017 18:32:51 +0100 [thread overview]
Message-ID: <20170322173257.63019-2-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170322173257.63019-1-luc.vanoostenryck@gmail.com>
This is used by GCC to report suspicious use of addresses.
So, reuse the same name for same or similar use.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
lib.c | 2 ++
lib.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/lib.c b/lib.c
index 272d2c88a..f4d5760b7 100644
--- a/lib.c
+++ b/lib.c
@@ -215,6 +215,7 @@ void die(const char *fmt, ...)
static struct token *pre_buffer_begin = NULL;
static struct token *pre_buffer_end = NULL;
+int Waddress = 0;
int Waddress_space = 1;
int Wbitwise = 1;
int Wcast_to_as = 0;
@@ -467,6 +468,7 @@ static const struct warning {
const char *name;
int *flag;
} warnings[] = {
+ { "address", &Waddress },
{ "address-space", &Waddress_space },
{ "bitwise", &Wbitwise },
{ "cast-to-as", &Wcast_to_as },
diff --git a/lib.h b/lib.h
index 134e56040..0bf8c97e4 100644
--- a/lib.h
+++ b/lib.h
@@ -101,6 +101,7 @@ extern void add_pre_buffer(const char *fmt, ...) FORMAT_ATTR(1);
extern int preprocess_only;
+extern int Waddress;
extern int Waddress_space;
extern int Wbitwise;
extern int Wcast_to_as;
--
2.12.0
next prev parent reply other threads:[~2017-03-22 17:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 17:32 [PATCH 0/7] fix function or array address in conditionals Luc Van Oostenryck
2017-03-22 17:32 ` Luc Van Oostenryck [this message]
2017-03-22 17:32 ` [PATCH 2/7] add is_func_type() Luc Van Oostenryck
2017-03-22 17:32 ` [PATCH 3/7] warn if testing the address of a function Luc Van Oostenryck
2017-03-22 17:32 ` [PATCH 4/7] add is_array_type() Luc Van Oostenryck
2017-03-22 17:32 ` [PATCH 5/7] warn if testing the address of an array Luc Van Oostenryck
2017-03-22 17:32 ` [PATCH 6/7] fix evaluation of a function or array symbol in conditionals Luc Van Oostenryck
2017-03-22 17:32 ` [PATCH 7/7] fix is_scalar_type() Luc Van Oostenryck
2017-04-01 10:36 ` [GIT PULL] fix function or array address in conditionals 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=20170322173257.63019-2-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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).