Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryandesign
Copy link

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

grok_config.h defines type struct config; conf.tab.h uses it.

Fixes "conf.tab.c:1302:1: error: conflicting types for 'yyparse'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant