Menu

Inline suppression of unusedFunction errors not working when using compile_commands.json

2020-01-06
2020-01-06
  • Viktor Kajml

    Viktor Kajml - 2020-01-06

    Hello,
    I cannot get inline suppression of unusedFunction errors to work when passing compile_commands.json to cppcheck. It works alright when I just pass a list of files, or when using the --suppress-xml or --suppressions-list arguments.

    It just doesn't work for:

    • unusedFunction errors

    • when using compile_commands.json

    • when using inline suppression

    I'm attaching a minimal example:

    If I run (inside the minimal-example folder):

    cppcheck --project=compile_commands.json --enable=all --inline-suppr
    

    I get an unusedFunction error.

    If I run:

    cppcheck --project=compile_commands.json --enable=all --suppress-xml=suppressions.xml --inline-suppr
    

    or

    cppcheck --enable=all --inline-suppr example.c
    

    I don't get any errors.

    Could this be a bug? Or is there a way to get inline supporession working when using the compile commands file?

     

    Last edit: Viktor Kajml 2020-01-06
  • Daniel Marjamäki

    Thanks! Sounds like a bug, I created a ticket: https://trac.cppcheck.net/ticket/9567

     

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.