[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning flags in 2.4.1
From: |
Joel E. Denny |
Subject: |
Re: warning flags in 2.4.1 |
Date: |
Sat, 9 Apr 2011 14:58:32 -0400 (EDT) |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Mon, 28 Mar 2011, Akim Demaille wrote:
>
> Le 28 mars 2011 à 04:56, Joel E. Denny a écrit :
>
> > I feel that -Wnone should affect all warnings. That's how it's currently
> > documented, and it seems like a useful feature. I'd like to push the
> > following patches to branch-2.5 and master. Any objections?
>
> none ;)
Thanks.
I've discovered that I'm not fully suppressing reports about useless
rules. I folded in the diff below to fix that and pushed to branch-2.5
and master. The next patch to come will test that stderr is fully
scrubbed.
diff --git a/ChangeLog b/ChangeLog
index eb2e1f9..5c79812 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@
(warnings_args, warnings_types): Add entry for warnings_other.
(usage): Update.
* src/getargs.h (enum warnings): Add entry for warnings_other.
+ * src/gram.c (grammar_rules_useless_report): If -Wno-other, then
+ don't print useless rules.
* src/reader.c (symbol_should_be_used): Rather than adjusting the
return value based on whether midrule value warnings are enabled,
accept a new parameter for telling the caller whether true is
diff --git a/src/gram.c b/src/gram.c
index 76accee..2121279 100644
--- a/src/gram.c
+++ b/src/gram.c
@@ -24,6 +24,7 @@
#include <quotearg.h>
#include "complain.h"
+#include "getargs.h"
#include "gram.h"
#include "print-xml.h"
#include "reader.h"
@@ -310,8 +311,11 @@ grammar_rules_useless_report (const char *message)
if (!rules[r].useful)
{
warn_at (rules[r].location, "%s: ", message);
- rule_print (&rules[r], stderr);
- fflush (stderr);
+ if (warnings_flag & warnings_other)
+ {
+ rule_print (&rules[r], stderr);
+ fflush (stderr);
+ }
}
}