bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: explicit empty right-hand side of a rule


From: Joel E. Denny
Subject: Re: RFC: explicit empty right-hand side of a rule
Date: Tue, 5 Feb 2013 19:44:59 -0500 (EST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Tue, 5 Feb 2013, Akim Demaille wrote:

> >> I feel that using %empty should be all or nothing, so any occurrence
> >> or %empty should enable -Wempty-rule, right?
> > 
> > Makes sense.  Would -Wno-empty-rule still disable it?
> 
> I have no strong opinion about this.  I'd go for the simplest
> implementation, which is to enable the warning when we meet
> %empty, regardless of whether -Wno-empty-rule was specified.
> But I'm open to other opinions (which would requite three
> states for the warning flags, instead of just two, not too big
> a deal).

If I specify -Wnone or -Wno-foo but I receive a warning about foo, that 
seems like a bug.  Moreover, -Wno-empty-rule might be useful for someone 
who wants to start incorporating %empty but is not ready to convert all of 
his very large grammar.

> >>> Also, in gcc and clang, -Wall does not include the default warnings.  
> >>> It's a separate category.  Quite a misnomer.  Maybe we should just not 
> >>> have a -Wall.
> >> 
> >> We already have one.  I have tried to model Bison's diagnostic interface
> >> to the one of gcc/clang.  In this regard, it would be weird not to support
> >> -Wall, which is fairly traditional.
> > 
> > I misunderstood your proposal when you mentioned -Weverything.  I realize 
> > now you meant that -Wempty-rule would be included in -Weverything but not 
> > in -Wall because the latter might be in widespread use.  Right?
> > 
> > If we really want -Wall to work like gcc's, then should -Wno-all also 
> > behave like gcc's?  That is, perhaps it shouldn't disable default 
> > warnings?
> 
> I am not yet convinced that we really want something
> more than -Wall, I was thinking aloud, throwing ideas
> to see if someone picks them :)
> 
> Do you think we should go in that direction?

How about the following proposal?

1. -Wall will continue to mean all warnings rather than trying to mimic 
gcc's -Wall.  If someone specifies -Wall, he has no right to complain that 
it enables a warning (such as -Wempty-rule) that he doesn't find useful.  
He explicitly requested all warnings that Bison provides and might ever 
provide.

2. -Wempty-rule will be off by default for now because it would likely be 
too noisy for projects not ready to rewrite for %empty.  A use of %empty 
will enable it by default.

3. Yacc mode should have no influence on whether -Wempty-rule is enabled.  
That is, because existing Yacc-compatible grammars don't use %empty, they 
won't produce the warnings unless the user has requested them.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]