Parsing this file to cppckeck with --project option.
Issue is that cppcheck is ignoring the included paths as paths having the double backslashes. Due to this not seeing cppcheck errors for header files, only seeing c files errors. This I conformed enabling --verbose, it was printing included path like -I……productapplication -I……sharedcommon -I……shared.
If we modify above json file replacing double backslashes with single forward slash then seeing cppcheck errors as expected.
Suspecting this is a bug in cppcheck tool.
Please clarify.
Last edit: Krishna 2021-04-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
could you tell us which cppcheck version you use. And can you attach the compile_commands.json ; it is fine if it is reduced I just want to know that the sourceforge wiki formatting hasn't changed your text somehow..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In my project cmake is generating compilation_commands.json for IAR toolchain. See below for example data.
{
“directory”: “D:\iar-release”,
“command”: "D:\IAR\Ver8_50_1\arm\bin\iccarm.exe --silent D:\AppStub.c -Itmh
-I…\…\product\application -I…\…\shared\common -I…\…\shared
“file”: “D:\AppStub.c”
}
Parsing this file to cppckeck with --project option.
Issue is that cppcheck is ignoring the included paths as paths having the double backslashes. Due to this not seeing cppcheck errors for header files, only seeing c files errors. This I conformed enabling --verbose, it was printing included path like -I……productapplication -I……sharedcommon -I……shared.
If we modify above json file replacing double backslashes with single forward slash then seeing cppcheck errors as expected.
Suspecting this is a bug in cppcheck tool.
Please clarify.
Last edit: Krishna 2021-04-23
could you tell us which cppcheck version you use. And can you attach the compile_commands.json ; it is fine if it is reduced I just want to know that the sourceforge wiki formatting hasn't changed your text somehow..
Hi Daniel,
Attached compile_commands.json. Using cppcheck 1.88 version .
It would feel good if you could try with cppcheck-2.4.1 because there has been several fixes in the import handling.
Thank you very much, with 2.4.1 issue is resolved.