diff mbox

[3/3,V2] lib.c: add Wall_off switch

Message ID 1438362734-14505-1-git-send-email-tcamuso@redhat.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Tony Camuso July 31, 2015, 5:12 p.m. UTC
Disables all warning and error reporting for using sparse as a
tokenizer only.

Signed-off-by: Tony Camuso <tcamuso@redhat.com>
---
 lib.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Tony Camuso July 31, 2015, 6:01 p.m. UTC | #1
On 07/31/2015 01:12 PM, Tony Camuso wrote:
> Disables all warning and error reporting for using sparse as a
> tokenizer only.
>
> Signed-off-by: Tony Camuso <tcamuso@redhat.com>

Spoke too soon ..

NAK

I'll send an update when I have something that really works.

> ---
>   lib.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/lib.c b/lib.c
> index 8dc5bcf..c274a68 100644
> --- a/lib.c
> +++ b/lib.c
> @@ -241,6 +241,7 @@ int Wtypesign = 0;
>   int Wundef = 0;
>   int Wuninitialized = 1;
>   int Wvla = 1;
> +int Wall_off = 0;
>
>   int dbg_entry = 0;
>   int dbg_dead = 0;
> @@ -464,6 +465,7 @@ static const struct warning {
>   	{ "undef", &Wundef },
>   	{ "uninitialized", &Wuninitialized },
>   	{ "vla", &Wvla },
> +	{ "all_off", &Wall_off },
>   };
>
>   enum {
> @@ -479,6 +481,12 @@ static char **handle_onoff_switch(char *arg, char **next, const struct warning w
>   	char *p = arg + 1;
>   	unsigned i;
>
> +	if (!strcmp(p, "all_off")) {
> +		for (i = 0; i < n; i++)
> +			*warnings[i].flag = WARNING_FORCE_OFF;
> +		return NULL;
> +	}
> +
>   	if (!strcmp(p, "sparse-all")) {
>   		for (i = 0; i < n; i++) {
>   			if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Wsparse_error)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib.c b/lib.c
index 8dc5bcf..c274a68 100644
--- a/lib.c
+++ b/lib.c
@@ -241,6 +241,7 @@  int Wtypesign = 0;
 int Wundef = 0;
 int Wuninitialized = 1;
 int Wvla = 1;
+int Wall_off = 0;
 
 int dbg_entry = 0;
 int dbg_dead = 0;
@@ -464,6 +465,7 @@  static const struct warning {
 	{ "undef", &Wundef },
 	{ "uninitialized", &Wuninitialized },
 	{ "vla", &Wvla },
+	{ "all_off", &Wall_off },
 };
 
 enum {
@@ -479,6 +481,12 @@  static char **handle_onoff_switch(char *arg, char **next, const struct warning w
 	char *p = arg + 1;
 	unsigned i;
 
+	if (!strcmp(p, "all_off")) {
+		for (i = 0; i < n; i++)
+			*warnings[i].flag = WARNING_FORCE_OFF;
+		return NULL;
+	}
+
 	if (!strcmp(p, "sparse-all")) {
 		for (i = 0; i < n; i++) {
 			if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Wsparse_error)