-
Notifications
You must be signed in to change notification settings - Fork 82
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
__has_include with angle-bracketed argument breaks preprocessing #229
Comments
ouch I thought this __has_include was fixed by now. Thanks for reporting! |
have we been able to fix this? or should someone submit a pull request? Follow up: are we actually finding the correct file? in that code is it actually searching for |
I didn't have time to look at this yet. A PR would be appreciated.
not sure I'd have to look in the code and/or debug.. |
No movement? Does someone externally need to PR this to get it done? It's pretty bad! This is a super common construct to use these days |
This is an open source project. The development team is just a group of volounteers that helps out for free in their spare time. I am hoping that Cppcheck Premium will grow and that we can someday pay some developer to work on Simplecpp and Cppcheck.. |
Sorry, didn't mean to come off the wrong way. I was just surprised about this one. I would try to fix it myself if I thought I could without breaking 8 other things. I imagine the learning curve is quite steep if you've never done something similar before. I can give it a go though if you want :) |
ok.
This code is not super trivial but imho this is probably a relatively nice task to start working with compared to some other tasks. Feel free to take a look I would appreciate a PR! |
Where would one start looking? |
spontanously I wonder what happens here: Line 3494 in b9bfbaa
at a quick glance it looks as if <> is handled. |
in this test case it looks like <> are handled: Line 1312 in b9bfbaa
|
can somebody create a test case that fails? I don't get a syntax error here:
|
The issues I was seeing with this seem to have been fixed by #271 (first included in cppcheck 2.10). |
ok thanks.. I will close this.. if anybody still see problems feel free to reopen this issue or open a new issue.. |
Preprocessing (in C++17 mode) of code like this:
results in an error:
This happens regardless of whether the mentioned header file exists or not.
Debugging shows that
<any>
is split in 3 tokens:<
,any
,>
, but the code for handling__has_include
expects one token as argument: https://github.com/danmar/simplecpp/blob/ab680f96ea9aa0fc7ed241f6dc51954d7a8d6735/simplecpp.cppAs a result the check to matching closing parenthesis fails (as
any
is not)
) and a fatal syntax error is reported: https://github.com/danmar/simplecpp/blob/ab680f96ea9aa0fc7ed241f6dc51954d7a8d6735/simplecpp.cppThis also affects Cppcheck - it reports
preprocessorErrorDirective
on that line and stops.The text was updated successfully, but these errors were encountered: