bison-patches
[Top][All Lists]
Advanced

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

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


From: Akim Demaille
Subject: Re: redeclarations: say "previous" not "first" declaration
Date: Sun, 9 Jul 2006 07:57:57 +0200

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?

Yes, I meant an error, but stick to the first definitions (i.e., ignore
the following ones).

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.

Arg, sorry.  Then do what you think is most convenient.

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.

They make this even "worse" by saying "a previous definition".

foo.cc:2: error: conflicting declaration 'void* foo'
foo.cc:1: error: 'foo' has a previous declaration as 'int foo'


"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?

That's my preference, but whatever consistant choice is OK with me.
I thought that scheme was implemented.




reply via email to

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