On Thu, Dec 31, 2015 at 12:01:10PM -0700, Todd C. Miller wrote:
> Hmmm, should the yyparse() proto really be static?  The actual
> yyparse() generated by yacc is not static.

the yyparse() as generated by yacc may be either static or extern
depending on the user's preference -- she's free to declare it
static in the %{ %} block or in a file included from there.

that's because the first declaration dictates the storage class;
a subsequent declaration/definition should either repeat it, omit it,
or declare it as 'extern'.

ex. ok, 'func' will be static:
static int func(void);
int func(void);
int func(void){ return 17; }
extern int func(void);

ex. *NOT* ok:
int func(void);
static int func(void){ return 17; }

Reply via email to