help-bison
[Top][All Lists]
Advanced

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

Unnecessary(?) declaration of flex


From: John P. Hartmann
Subject: Unnecessary(?) declaration of flex
Date: Sat, 14 Aug 2010 10:56:56 +0200

What is the purpose of this declaration in the generated C file:

extern int yylex (void);

I can see that I can define a macro to turn it off, but it seems to
serve no purpose as the function is defined anyhow about fifteen lines
below.  I suppose a purist might even object to "extern".

You'll get a warning from GCC when the lexer is embedded in a parser:

In file included from rexxy.y:108:
rexxl.c:1689: warning: redundant redeclaration of 'yylex'
rexxy.y:18: note: previous declaration of 'yylex' was here

Thanks,

   j.



reply via email to

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