Menu

Which suppressions of a suppression file are actually used?

Martin
2021-02-10
2021-02-10
  • Martin

    Martin - 2021-02-10

    Hi,

    is there a way to find out which suppressions of a suppression file are actually used?
    Over time for our projects huge suppression files have accumulated, and I'd like to weed out all the lines which are not relevant any more.

    Thanks,
    Martin

    P.S.: I have a feeling that this has been asked before, but I couldn't find it in the forum :-/

     
  • Daniel Marjamäki

    If you use --enable=information then Cppcheck will tell you that.

    Try this on some arbitrary file:

    $ ./cppcheck --suppress=aaaa --enable=information test.cpp
    

    Obviously.. no "aaaa" warning will be reported. So it is expected that you get such information from Cppcheck:

    nofile:0:0: information: Unmatched suppression: aaaa [unmatchedSuppression]
    

    This should work for inline suppressions and suppressions in file, as well..

     

    Last edit: Daniel Marjamäki 2021-02-10
  • Martin

    Martin - 2021-02-10

    This works, thanks!

     

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.