-
Notifications
You must be signed in to change notification settings - Fork 80
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
syntax error: failed to expand 'HASH_TOKEN_IN_MACRO' #328
Comments
This code is undefined behavior. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf page 152 If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives,150) the behavior is undefined |
@danmar Agreed that the code is bad, the linter should flag it and carry on, rather than grind to a halt and stop checking the rest of the code. As a side note this code was created to evaluate linters. Out of five linters Cppcheck was the only one that stopped checking after encountering this error. |
@parrotrueper I would hope you can consider to fix the evaluation code somehow then. And evaluate cppcheck using that. A user would fix the code and then recheck.. |
alright I guess we can reopen this. Fixing this doesn't mean we have to remove the error message... |
From https://trac.cppcheck.net/ticket/12105
foo.cpp:5: syntax error: failed to expand 'HASH_TOKEN_IN_MACRO', it is invalid to use a preprocessor directive as macro parameter
The text was updated successfully, but these errors were encountered: