Hi,
I am trying to suppress the syntaxErrors in my files as they are C++/CL files and often syntaxError is reported for CL code.
I used following argument to suppress syntaxError for entire code base but it is not suppressing all the syntaxErrors: tried all suppressions txt, command line and inline but no luck Inline :
cppcheck src\folder --xml --force --inline-suppr 2>resultslocal11.xml
In file:
// cppcheck-suppress syntaxError
Results:
It successfully suppresses the errors with following description:
<error msg="syntax error" verbose="syntax error" id="syntaxError" severity="error"></error>
but still throws the following syntaxErrors as bugs:
<error msg="The code contains unhandled character(s) (character code=208). Neither unicode nor extended ascii is supported." verbose="The code contains unhandled character(s) (character code=208). Neither unicode nor extended ascii is supported." id="syntaxError" severity="error"></error>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry that was typo, I meant C++/CLI File/
Also we figured out the issue atleast with the character that is causing this error. But main issue is why its not suppressing the error even though we have set up that rule.
Hi,
I am trying to suppress the syntaxErrors in my files as they are C++/CL files and often syntaxError is reported for CL code.
I used following argument to suppress syntaxError for entire code base but it is not suppressing all the syntaxErrors: tried all suppressions txt, command line and inline but no luck
Inline :
cppcheck src\folder --xml --force --inline-suppr 2>resultslocal11.xml
In file:
// cppcheck-suppress syntaxError
Command Line:
cppcheck src\folder --xml --force --suppress=syntaxError 2>resultslocal02.xml
Results:
It successfully suppresses the errors with following description:
<error msg="syntax error" verbose="syntax error" id="syntaxError" severity="error"></error>
but still throws the following syntaxErrors as bugs:
<error msg="The code contains unhandled character(s) (character code=208). Neither unicode nor extended ascii is supported." verbose="The code contains unhandled character(s) (character code=208). Neither unicode nor extended ascii is supported." id="syntaxError" severity="error"></error>
What exactly do you mean with
CL
?Can you post a minimal example where you see this behaviour?
Sorry that was typo, I meant C++/CLI File/
Also we figured out the issue atleast with the character that is causing this error. But main issue is why its not suppressing the error even though we have set up that rule.
Attaching a sample file.
I can reproduce that the supression does not work in Cppcheck V1.84.
With the latest development code (git head) it seems to be fixed:
Fixing this ticket could have fixed your issue too:
https://trac.cppcheck.net/ticket/7792
So with Cppcheck V1.85 (not yet released) the supression of syntaxError should work correctly for you.
Thanks for the fix, will wait for the new version !!