[Top][All Lists]

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

Re: [PATCH] Factor %FLAG at scan level.

From: Joel E. Denny
Subject: Re: [PATCH] Factor %FLAG at scan level.
Date: Thu, 9 Apr 2009 01:10:22 -0400 (EDT)

On Wed, 8 Apr 2009, Akim Demaille wrote:

> > I found it:                                                                 
> >                                                                             
> >      
> Thanks, I read it (maybe too fast though).                                    
> > But I think the main revelation is below....                                

I guess I shouldn't have quoted that thread.  Sorry you had to read it.  
The discussion is out of date: --define didn't exist then.

> > Instead of allowing the user to disable the warning globally, I think
> > Bison can provide a more careful and flexible solution.  Bison would warn
> > if --define contradicts %define, but Bison would not warn if
> > --force-define contradicts %define.
> I don't like the explosion of the number of options.

It's just one new option:

And it would be straight-forward to implement.

> If you really want to
> walk that way, let's introduce more flavors of -D, say -DFOO?=Value that would
> have low priority, -DFOO!=Value to override (too bad it looks so much as an
> inequality) etc.  But it seems a bit overkill to me.

That's cryptic.  Is --force-define too long?  I'm sure we can come up with 
a decent short version if necessary.  Maybe -F.

> My fear with this warning is that I fear it will become one of these warnings
> that today make my life uselessly more complex.

How often do you believe you'll need to override grammar declarations?  
Is it really that complex to convert to --force-define or -F when you do?  
On the other hand, as a Bison expert who never trips on the easy stuff, 
you can just use --force-define or -F every time.

> Before, everything that was
> in GCC's -Wall and even -Wextra were really truly useful warnings that I did
> not want to see in my code, so I even use -Werror.  Now there are warnings for
> kids in GCC.  I hate that gcc requires parens here:
>         if (a && b
>             || c && d)
> around the conjunctions (will it some day require parens for a * b + c * d?)

I don't understand their motivation here either, but I haven't found it 
hard to cope with.

> Similarly I can't write
>       if (a)
>         if (b)
>           c;
>         else
>           d;
> now it wants braces for the inner if!

That's a part of the GNU coding standards that getargs.c on master 
currently breaks.

> That in the end the question is: should the interface be tailored for
> experienced users, or novices.  Both opinions are perfectly defendable, but we
> need to make our mind once on this regard, and be consistent afterwards.

I'm surprised to see you argue this way after you recently supported the 
"misleading reference" concept for Alex's value names.

I'm a novice in many ways.  I usually find that careful warnings save me 
more frustration than they cause.

reply via email to

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