Menu

cppcheck not considering the included paths with '\\'

Krishna
2021-04-23
2021-04-26
  • Krishna

    Krishna - 2021-04-23

    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
  • Daniel Marjamäki

    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..

     
  • Krishna

    Krishna - 2021-04-26

    Hi Daniel,

    Attached compile_commands.json. Using cppcheck 1.88 version .

     
  • Daniel Marjamäki

    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.

     
  • Krishna

    Krishna - 2021-04-26

    Thank you very much, with 2.4.1 issue is resolved.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.