yacc is generating a y.tab.c without yylex prototype

bmoore@nyx.net
2 Jul 2005 20:19:33 -0400

          From comp.compilers

Related articles
yacc is generating a y.tab.c without yylex prototype bmoore@nyx.net (2005-07-02)
| List of all articles for this month |
From: bmoore@nyx.net
Newsgroups: comp.compilers
Date: 2 Jul 2005 20:19:33 -0400
Organization: Compilers Central
Keywords: lex
Posted-Date: 02 Jul 2005 20:19:32 EDT

Hello -


I have a yacc question and hope this is an appropriate newsgroup.
If not I'd appreciate any pointers to a better place to post it.


I am using yacc on a Linux system and to my surprise, the y.tab.c it
outputs does not contain a prototype for yylex, i.e.


int yylex(void);


This causes y.tab.c to fail compilation. The same yacc input file
produces proper output on a Solaris system. Is there some switch needed
on the Linux to force the yylex prototype? Maybe some header file needs
to be included?


Thanks for any suggestions.


Bill Moore
[Different version. Just put the right prototype in an include file.
So long as it's the same as the one that later versions of yacc might
generate, it won't break anything even if the prototype is there. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.