Menu

CPPcheck with JSONDB file shows no errors

2022-03-08
2022-04-27
  • Karsten Beck

    Karsten Beck - 2022-03-08

    The basis of this problem is the topic https://sourceforge.net/p/cppcheck/discussion/general/thread/608af51e0a/?limit=25#98b6
    (CPPcheck does not include files from the Project Options)

    @danielmarjamaki recommended to include the project via JSONDB -file. IAR as of version 9 can create a JSON file from the project, which I passed to CPPcheck.
    However, the output now only shows functions that are not used [unusedFunction].
    If I check the files individually (passed directly) or the entire project (project directory), then various other errors are displayed. However, when using the JSON file, they do not.

     
  • Karsten Beck

    Karsten Beck - 2022-03-29

    Doesn't anyone have any ideas on how I can proceed?

     
  • Karsten Beck

    Karsten Beck - 2022-04-26

    @danielmarjamaki Do you have any idea where the problem might be?

     
  • Daniel Marjamäki

    There has been a couple of fixes in the import of compile databases. If you want you could try to install cppcheck-2.7.5 and see if issues has been fixed.

     
  • Karsten Beck

    Karsten Beck - 2022-04-27

    Hi @danielmarjamaki
    thank you very much for your answer. I just installed version 2.7.5 and then nighty build 776. Both throw a syntax error with the last closing ] brace of the json file when calling the compile-database file.
    Checking the file with https://jsonlint.com/ showed that it is error-free.

    Is there maybe another bug here?

    D:\Projekte\xyz\firmware\app\Debug>c:\Programme\Cppcheck\cppcheck.exe jsondb.json
    Checking jsondb.json ...
    jsondb.json:881:1: error: syntax error [syntaxError]
    ]
    ^
    

    Best wishes
    Karsten

     

    Last edit: Karsten Beck 2022-04-27
  • Daniel Marjamäki

    try:

    D:\Projekte\xyz\firmware\app\Debug>c:\Programme\Cppcheck\cppcheck.exe --project=jsondb.json
    
     

    Last edit: Daniel Marjamäki 2022-04-27
    • Karsten Beck

      Karsten Beck - 2022-04-27

      UPDATE:
      This is no error, wrong syntax from me. Correct would have been:
      `D:\Projekte\xyz\firmware\app\Debug>c:\Programme\Cppcheck\cppcheck.exe --project=jsondb.json``
      With this it works!

      Thanks a lot!

       

      Last edit: Karsten Beck 2022-04-27

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.