On Sat, Mar 28, 2015 at 09:42:00AM -0300, Renato Westphal wrote: > I don't think that this is necessary. Yacc includes a skeleton C code > when generating a parser from a grammar specification file (.y) and > the stdlib header is in there: > > char *banner[] = > { > "#include <stdlib.h>", > "#include <string.h>", > "#define YYBYACC 1", > "#define YYMAJOR 1", > "#define YYMINOR 9", > "#define YYLEX yylex()", > "#define YYEMPTY -1", > "#define yyclearin (yychar=(YYEMPTY))", > "#define yyerrok (yyerrflag=0)", > "#define YYRECOVERING() (yyerrflag!=0)", > NULL > }; > > If you include the stdlib header in the .y file you will end up with > two includes for the same header in the .c file.
You would be right for whatever version you are looking at, but newer versions stopped doing that. They no longer include either header in the banner. Joerg