jordansissel / grok

DRY and RAD for regular expressions and then some.
http://code.google.com/p/semicomplete/wiki/Grok
Other
244 stars 53 forks source link

Include grok_config.h before conf.tab.h #42

Open ryandesign opened 2 years ago

ryandesign commented 2 years ago

Paul Eggert explained on the bison mailing list:

This is because grok's #include order is messed up. conf.y includes conf.tab.h (which uses the type struct config) before it includes grok_config.h (which defines the type). C requires declaration before use, so it should include the files in the other order. Some compilers will go ahead and compile anyway, depending on their flags; others won't.

Fixes:

conf.tab.c:1302:1: error: conflicting types for 'yyparse'
yyparse (struct config *conf)
^
conf.tab.h:116:5: note: previous declaration is here