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

Handling error message from cpp "header toto.h not found". #31

Closed
gryken2014 opened this issue Mar 20, 2014 · 1 comment
Closed

Handling error message from cpp "header toto.h not found". #31

gryken2014 opened this issue Mar 20, 2014 · 1 comment

Comments

@gryken2014
Copy link

Problem :

  • pycparser analyse a c source file,
  • the c source includes a header file, which doesn't exist.

cpp print a message like "header toto.h not found", on the console.
But pycparser doesn't handle this message, and the analysis is done anyway.

Proposition :

  • handle this kind of messages (read from stderr, when cpp is launch),
  • create an exception to stop the pycparser analysis, and avoid a false analysis

Thanks for you help

@eliben
Copy link
Owner

eliben commented Mar 22, 2014

pycparser's main goal is to parse correct C code. The parse_file function is just a thin helper over the parser, and I'm reluctant to add too much functionality to it (like examining return codes from different kinds of cpp programs).

Feel free to implement your own variant of parse_file that does exactly what you need.

@eliben eliben closed this as completed Mar 22, 2014
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

No branches or pull requests

2 participants