bison-patches
[Top][All Lists]
Advanced

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

Re: {maint} yacc.c: initialize yylval in pure-parser mode


From: Paul Eggert
Subject: Re: {maint} yacc.c: initialize yylval in pure-parser mode
Date: Thu, 27 Sep 2012 09:11:50 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 09/27/2012 08:38 AM, Akim Demaille wrote:
> In fact, one of your initial goal was:
> 
>> > And in the unusual case where
>> > where yylval really *isn't* initialized -- because the lexer is
>> > buggy -- GCC will issue the warning, which will be a good thing.

> AFAICT, it is not the case, GCC does not complain in the following
> attached test case where yylval is _not_ initialized.

If memory serves, GCC was correct to not complain in that test case,
because the value of yylval was not used.

As I understand it, what we have is:

 * The current situation, where GCC sometimes incorrectly
   cries wolf.

 * The simple patch you're proposing, which will cause
   GCC to sometimes be silent even when there's a real wolf.

 * The more-complicated patch I'm proposing, which will cause
   GCC to be more accurate about wolf-reporting.

The code's pretty complicated already (it already has gotos
into blocks, in other places), and the extra complexity
introduced by the more-complicated patch is not really
all that much, which is why I proposed it.



reply via email to

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