Closed heemonsu closed 3 years ago
What is the plug-in version? and What is the cppcheck version?
I can add single quotes, but I don't think that's the root cause
Try v1.4.0 and look forward to your feedback
Hey, sorry just saw this thread. When I had the issue, I was using 1.3.8 version of the extension and cppcheck 1.72. I gave 1.4.0 a try, and it looks like its working, thanks!
I found the reason, template set "{file}:{line}:{column}: {severity}: CWE-{cwe} {message}:[{id}]",
but cppckeck version less than 1.72 "template" is not supported "{column}"。
v1.72 result is :
main.cpp:10:{column}: error: CWE-{cwe} Possible null pointer dereference: p:[nullPointer]
Higher version result is :
main.cpp:10:5: warning: CWE-476 Possible null pointer dereference: p:[nullPointer]
regular expression is: ^(.):(\d+):(\d+):\s(\w+):\s(.):[([A-Za-z]+)]$/ So the match failed。 now regular expression is: ^(.):(\d+):(\d+|{column}):\s(\w+):\s(.):[([A-Za-z]+)]$/
please try v1.4.1
I gave 1.4.0 a try, and it looks like its working, thanks! ---- I don't think v1.4.0 can be working will
While using
cppcheck
on a file, I noticed that the command was failing because the executing command was this:Since there is a space in the given template, according to cppcheck documentation, it looks like the argument to the template needs to be wrapped with a single quote(').
I tried that out locally by copying the full command and using single quotes, and the command ran without issues: