Menu

Suggestion for enhancing for suppression mechanism

2020-05-07
2020-05-20
  • Gal Zimmerman

    Gal Zimmerman - 2020-05-07

    Currently, there are following means for suppression of certain types of errors via plain text:
    1. [error id]:[filename]:[line]
    2. [error id]:[filename2]
    3. [error id]

    We don’t like inline suppression.
    Line suppression ([error id]:[filename]:[line]) is not good enough because when people add lines it changes the line.
    File suppression is too broad and might hide other defects.
    We would like to have a suppression in a level of function. For example:
    1. If we have such waring:
    “For the message: “[module/myfile.c:558]: (warning) nullPointer - Possible null pointer dereference: htab_data”
    2. We would like to suppress the warning on the function level by adding the following line to the suppression file: [nullPointer][myfile.c][myfunction]

     
  • Daniel Marjamäki

    shouldn't be very hard to solve this. but well I want that the suppression format is deterministic. feel free to look at this.

    I created this ticket in trac:
    https://trac.cppcheck.net/ticket/9704

     
  • Steven Cook

    Steven Cook - 2020-05-20

    I think this is a great idea. The other suppression I would find useful is being able to suppress warnings for certain function calls. Specifically I would like to suppress the knownArgument check on assert calls. But I expect this would be a harder one to implement.

     
  • Daniel Marjamäki

    It seems unfortunate to write knownArgument warnings for assert calls. I created https://trac.cppcheck.net/ticket/9736 for that.

     

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.