[Top][All Lists]

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

Re: redeclarations: say "previous" not "first" declaration

From: Joel E. Denny
Subject: Re: redeclarations: say "previous" not "first" declaration
Date: Sat, 8 Jul 2006 17:09:47 -0400 (EDT)

On Sat, 8 Jul 2006, Akim Demaille wrote:

> > In the case of symbol redeclarations, Bison was reporting the location of
> > the previous declaration but calling it the first declaration.  Since it's
> > an error, I don't see why it matters which it does as long as it uses the
> > right word.
> Agreed.  But it seems more consistent to ignore the failures, and
> therefore to stick to the first declaration.

By "ignore the failures", do you mean make it a warning rather than an 
error?  Or do you just mean that Bison should always refer back to the 
first declaration in its error messages?

> I didn't know it had
> this behavior, thanks for stating.  In other places (%type, %printer
> etc.) it ignores following definitions and sticks to the first one.

That's what it *says*, but that's not what it does.  The line number of 
the "first" declaration increases with each new error message.  I just 
checked Bison 2.3 for %type.

> We should stick to this scheme for consistency.  That's also what
> the compilers I know do (gcc uses the word "previous" though :)

:)  I guess "previous" is ambiguous.  "first" is probably also ambiguous 
but seemed like the worse choice given what Bison was actually reporting.

So, you prefer Bison to report the actual first declaration in the grammar 
file and to say "first", right?

> > In the case of merger result type clashes, I changed it to match what
> > Bison was doing for symbol redeclarations.  I'm not sure why this is a
> > warning and not an error.
> > 
> > What would you like to have happen?
> I'd say this is an error, and we should stick to definition #1.



reply via email to

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