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]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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]
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
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.
It seems unfortunate to write knownArgument warnings for assert calls. I created https://trac.cppcheck.net/ticket/9736 for that.