At 08:50 PM 8/4/2010, Joel E. Denny wrote:
George wrote:
> > Also on page 114, the manual says "--warnings=none" or "-Wnone" should
> > suppress all warnings. This does not work. Grammar warnings,
if any, are
> > generated regardless of this setting.
>
> Thanks for mentioning that. I hadn't noticed it before, and I agree it is
> confusing. I think the idea was that -Wnone (or --warnings=none) simply
> disables all warnings that can be enabled by the other -W options. It's
> not clear to me if the documentation or the behavior needs to be fixed
> here.
Any opinions on this from anyone?
If we decide that -Wnone should affect all warnings, then we probably need
to add some kind of -Wother option for all warnings that do not have their
own -W option. The documentation should make it clear that we might later
move warnings from -Wother to new, more specific -W options.
Regardless of which functionality we pick for -Wnone, it probably should
not affect -Werror. Currently, it disables it. Even if we decide that
-Wnone should disable all warnings, it still should not affect -Werror in
the following case:
bison -Werror -Wnone -Wyacc parser.y
That is, POSIX Yacc warnings would be the only warnings and would be
treated as errors.
I think the real issue is the interpretation of the -W flags and the
documentation.
Generally when I see something that says "-Wblah warns of blah blah
...", I assume that I will not get those warnings unless I specify
that flag. By that interpretation only one of -Wblah or -Wno-blah
should be necessary and -Wnone is superfluous if all it does it
suppress other named -W warnings.
The only real use case I see for -Wnone is to force a clean build
from a grammar that has known warnings ... some companies have a
policy about clean test/release builds and the person doing the build
isn't always the developer. But it is normal to have different flags
for different types of builds so I don't see a problem with making
-Wnone incompatible with other -W flags.
George