Menu

cppcheck stopped working: error: syntax error for every JSON compilation DB file

gruenich
3 days ago
1 day ago
  • gruenich

    gruenich - 3 days ago

    For a couple of weeks cppcheck stopped working for me. Every JSON Compilation Database file I pass to cppcheck is rejected by a syntax error. It is always the last square bracket. The JSON files are created by CMake 4.2, 4.3, and Bear 3.1.6. Even if I try to create a trivial JSON file by hand, I get the error.

    > /home/gruenich/cppcheck/build/bin/cppcheck compile_commands.json
    Checking compile_commands.json ...
    compile_commands.json:260:1: error: syntax error [syntaxError]
    ]
    ^
    

    I tried with 2.19, 2.20 and main. Nothing works. In the past, 2.19 was working. To make things more mysterious, for main I ran ctest and all tests passed.

    Any idea how to pinpoint the cause of my issue?

     
  • CHR

    CHR - 1 day ago

    You could set a breakpoint on the syntax error and check what is causing it. Maybe an encoding issue?

     

Log in to post a comment.

MongoDB Logo MongoDB