Menu

Ignore explicitly specified file works only sometimes

2018-08-01
2018-08-02
  • Daniel Bengtsson

    Hi,

    I have a script that based on different conditions will run cppcheck on a different set of files. However I am struggling with some inconsistent weirdness, when I run the following command:

    cppcheck -ifile.c file.c
    

    With some cppcheck binaries I get the following output

    cppcheck: error: no files to check - all paths ignored.
    

    which is what I expect - I want to be able to ignore files even though they are explicitly listed.

    But with other cppcheck binaries I get:

    Checking file.c ...
    :
    

    and it starts to check file.c as if the ignore arg was not there.

    On linux I have an old 1.61 version that do ignore, and on windows I have 1.79 version that also ignores. But I would like to have a newer linux version that behaves like that, and I have tried to compile all versions between 1.77 to 1.84 and everyone of them scans the file anyway and reports issues (even the 1.79 version that behaves differently on windows). I have built all the linux versions manually using "make -j4".

    (I have even tried to experiment with ignoring in the suppressions-list file, but it seems to be the same problem there.)

    What might cause this difference?

     

    Last edit: Daniel Bengtsson 2018-08-01
  • Daniel Bengtsson

    Using the suppressions-list file instead seem to work, so I'll use that instead.

    Still confusing with the different behavior of -i though.

     

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.