bug-bison
[Top][All Lists]
Advanced

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

Re: bison-2.6.4-generated parser triggers pragma warnings in GCC 4.6.3


From: Akim Demaille
Subject: Re: bison-2.6.4-generated parser triggers pragma warnings in GCC 4.6.3
Date: Mon, 29 Oct 2012 08:02:57 +0100

Le 28 oct. 2012 à 18:35, Paul Eggert a écrit :

> On 10/28/2012 10:28 AM, Akim Demaille wrote:
>> What would you suggest?
> 
> If it's user code that's provoking the code,
> then I'd add user pragmas to disable the warnings.
> It's just a test case, so it'd also be OK to add
> user initializations to pacify GCC.

I'm not sure I understand.  Are you suggesting that we
tell our users to use our YY_PRAGMA macros around their
pieces of code that might be hit by GCC's weird warnings?
This test case is just demonstrating that it is possible
for users to have this problem, so what we have to do to
have it compile cleanly, is what users might have to do.

The example I sent is correct: yylval is properly set,
GCC is wrong.  Having to analyze table-driven code is not
something GCC is designed for.  So it reports a possible
failure for which, AFAICS, there is no runtime execution
path that can use an uninitialized yylval.

Wrapping their code with these YY_PRAGMA is wrong, since
if at these places they introduce variables and fail to
initialize them, we disable the warnings they should have had.
Yet, I feel very uneasy with having to request users to insert
YY_PRAGMA in their actions.




reply via email to

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