[Top][All Lists]

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

Re: FYI: master: c++: fix GCC8 warnings about uninitialized values

From: Akim Demaille
Subject: Re: FYI: master: c++: fix GCC8 warnings about uninitialized values
Date: Fri, 17 Aug 2018 19:42:47 +0200

> Le 17 août 2018 à 09:00, Paul Eggert <address@hidden> a écrit :
> Akim Demaille wrote:
>> The problem is that I could not find any place where this pragma is 
>> effective except the definition of yylval itself:
> That's where I would expect the pragma to work.
> Sorry, I've lost context. But can't you also get rid of the warning by having 
> YY_INITIAL_VALUE (= yyval_default) expand to '= yyval_default'? I vaguely 
> remember doing this long ago.

You did that for the compilers that do not support the pragma.  ISTR that I was 
in favor of always initializing yylval, but you commented that that would 
prevent the compiler from reporting the user that she forgot to set yylval :)

Unfortunately it seems that it does not work: if we take the input.y file from 
my previous message and _remove_ the definition of yylval in yoles then… GCC no 
longer warns!

Let me say it again: if yylval is assigned in yoles then GCC complains yylval 
might be uninitialized, while if we remove this assignment, it finds the code 
is ok (well, with all the current pragmas.  Note that yylex is not in a section 
where the warning is disabled).

I’m fine with with whatever choice we make.

reply via email to

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