Menu

Regarding included paths format in compiling database file

Krishna
2021-04-23
2021-04-25
  • Krishna

    Krishna - 2021-04-23

    I'm using compiling database(compile_commands.json) file for IAR toolchain.
    Below is the json format data for a single file.

    {
    “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”
    }

    Now my concern is, Does the above "command" format path and included paths accepts(-I) if compile_commands.json file passed to cppcheck with --project option?

    I'm not seeing any errors that path not found etc. But in the cppcheck user manual it was mentioned only the paths with forward slashes. My assumption is that cppcheck is ignoring due to unacceptable path as it is taking only approximately 300ms for a single file.

    Please clarify...!

     
  • Daniel Marjamäki

    My assumption is that cppcheck is ignoring due to unacceptable path as it is taking only approximately 300ms for a single file.

    Yes that sounds very suspicious.

    But the command says that the source file is "D:AppStub.c" I assume that is wrong somehow. Maybe wiki formatting changed your text. Can you attach some real json in a file?

    I have not tested how well IAR compiler command lines are understood by Cppcheck. Maybe we need some tweak in Cppcheck to understand the command line better.

     

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.