From c9fec04c98b729f6d5ec0c8420af2061a85244a6 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Wed, 22 Mar 2017 15:59:40 +0100 Subject: [PATCH] teach sparse about -Waddress 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 --- lib.c | 2 ++ lib.h | 1 + 2 files changed, 3 insertions(+) diff --git a/lib.c b/lib.c index 272d2c88..f4d5760b 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 134e5604..0bf8c97e 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.11.4.GIT