diff mbox

[1/7] teach sparse about -Waddress

Message ID 20170322173257.63019-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck March 22, 2017, 5:32 p.m. UTC
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 mbox

Patch

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;