There is a need for suppressing static analyzer warnings in specific parts of a source file (usually for silencing known false positives).
This change allows a user to suppress the static analyzer on a line-by-line basis using the comment: //clang_sa_ignore[<specific checker here>]
eg:
int b = 5; int c = 0; int tx = b/c; // clang_sa_ignore [core.DivideZero]
If there is more than one warning associated with the line that you would like to suppress, then provide a comma separated list of ids:
// clang_sa_ignore [<id1>,<id2>,<id3>]
The user must annotate the specified checker(s). In order to do this, the analyzer warnings contain the identity of the checker being invoked. The warning message will be of the form:
<file name>:<line number>:<column number>:clang_sa_warning: <warning text> [<id>]
eg: /local/mnt/workspace/analyzer-ignore.cpp:65:13: clang_sa_warning: Division by zero [core.DivideZero]
Contains contributions from hiraditya (Aditya Kumar)