Menu

cppcheck not showing all errors in XML

Ben
2024-10-31
2024-10-31
  • Ben

    Ben - 2024-10-31

    Apologies. This is a re-post and I can't delete the other one which has no subject. That happened because SourceForge logged me out when I was trying to post. When I logged it, it deleted the Subject :(

    I have a directory with around 42 C++ files. When I run cppcheck using --enable=all using the directory as the path, it will find errors in only 7 of the 42 files. This seemed odd to me.

    I did some individual files which were not part of the 7. When run individually, they had errors.

    I also tried another approach where I generated a file list of the files and used that with --file-list. But I got the same results.

    I looked at the args and didn't see anything that would indicate I am doing something incorrect.

    My command line looks like this

    C:\Program Files\Cppcheck\cppcheck.exe -DCPPCHECK_DUMMY --library=android.cfg --includes-file=includes.txt -v --enable=all --check-level=exhaustive --file-list=input-file-list.txt --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unusedFunction --suppress=unmatchedSuppression --xml --output-file=foobar

     
  • Ben

    Ben - 2024-10-31

    Yeah, I confirmed this behavior is happening. I wrote a program that will either call cppcheck for each file in the list or call cppcheck once, using the full list of 42 files.

    List of 42 files:
    Unique Errors: 18
    Total Errors: 170
    Files with errors: 7
    Total Files processed: 42

    cppcheck called 42 times, interating list of 42 files
    Unique Errors: 18
    Total Errors: 404
    Files with errors: 29
    Total Files processed: 42

     
  • Ben

    Ben - 2024-10-31

    I will also note that invoke cppcheck for each file did roughly double the time to run.

     

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.