From: Akim Demaille Date: Thu, 25 Jul 2013 14:04:26 +0000 (+0200) Subject: yacc: beware of "uninitialized uses" warnings X-Git-Tag: v3.0~4 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/d3ae5af6ec7dbcfa2c7dce1a175e35934b85b274?hp=d3ae5af6ec7dbcfa2c7dce1a175e35934b85b274 yacc: beware of "uninitialized uses" warnings Again some issues with the fact that yylval is reported by GCC as possibly not initialized in some cases. Here, the case at hand is the %destructor. I am still not convinced that it is worth going all the trouble of using pragmas to disable temporarily some warnings, instead of just initializing the looking symbol once for all, but that's what Paul voted for, see . * data/c.m4 (b4_attribute_define): Define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_INITIAL_VALUE here, as we will need them in the generation of the destructor function, which is defined in yacc.c before yyparse, which was in charge of defining these macros. * data/yacc.c (b4_declare_scanner_communication_variables): Simplify: trying to factor the definitions of the case pure and impure is too complex. Actually, it is not even clear that this macro should really exist, as even the calls are complex. Be careful not to issue a lone ";", as this is a statement, and C90 forbids declarations after statements ; so write "YY_INITIAL_VALUE(Decl;)", not "YY_INITIAL_VALUE(Decl);". ---