Wireshark-users: Re: [Wireshark-users] Build failures with ascend.c

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Sat, 24 Feb 2018 01:57:09 -0800
On Feb 19, 2018, at 12:26 AM, Jungle Boogie <jungleboogie0@xxxxxxxxx> wrote:

> I can't build wireshark from master src because of this:
> CC       toshiba.lo
>  CC       visual.lo
>  CC       vms.lo
>  CC       vwr.lo
>  CC       wtap.lo
>  CC       wtap_opttypes.lo
>  CC       ascend.lo
> ascend.c: In function 'ascendparse':
> ascend.c:38:20: error: declaration of 'ascendlval' shadows a global declaration [-Werror=shadow]                                                                                    
> #define yylval     ascendlval
>                    ^
> ascend.c:670:14: note: in expansion of macro 'yylval'
>     YYSTYPE  yylval;
>              ^
> In file included from ./ascend.y:150:0:
> ascend.h:25:16: note: shadowed declaration is here
> extern YYSTYPE ascendlval;
>                ^

Was the build done with Bison or Berkeley YACC?  Berkeley YACC appears to have a misfeature wherein it generates a global declaration of yylval - or the prefixed equivalent - in the .h file, *even though it was told to generate a reentrant parser which doesn't use a global yylval*.