I stepped into the source code and it turned out to be that the syntax error was due to missing ';' at the end, therefore an exception was raised during preprocessing(simplifyTokens). It doesn't pass the symbol name (DEF_VAR) to the error message, so errors on this symbol will not be suppressed.
And I cannot define a rule to make it a different severity because it happens during preprocessing.
The only way I currently found working was adding inline suppression (too many of them) or suppressing the error for the whole file (other errors in the file will be suppressed, too).
My questions:
Is it the intention that symbol name is not passed to the error message during preprocessing so that it is not supposed to be suppressed? If yes why?
What would be the best why to suppress this error? (This is a compiler specific syntax)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For gcc yes. But there are other compilers in the world for example chess compiler from Synopsys takes lines like _symbol myvar 123 without semicolon in the end
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cppcheck reports syntaxError on the following code:
Output:
I stepped into the source code and it turned out to be that the syntax error was due to missing ';' at the end, therefore an exception was raised during preprocessing(simplifyTokens). It doesn't pass the symbol name (DEF_VAR) to the error message, so errors on this symbol will not be suppressed.
And I cannot define a rule to make it a different severity because it happens during preprocessing.
The only way I currently found working was adding inline suppression (too many of them) or suppressing the error for the whole file (other errors in the file will be suppressed, too).
My questions:
Is it the intention that symbol name is not passed to the error message during preprocessing so that it is not supposed to be suppressed? If yes why?
What would be the best why to suppress this error? (This is a compiler specific syntax)
if it's some kind of variable declaration it should end with a semicolon or something.
gcc output:
For gcc yes. But there are other compilers in the world for example chess compiler from Synopsys takes lines like _symbol myvar 123 without semicolon in the end