HP Code Advisor
Example 6-6 Generating reports based on severity
$ cadvise report -pdb test.pdb –all –severity 2.
This command prints all diagnostics of severity levels greater than or equal to two.
6.9 Suppressing Diagnostics for Specific File(s)
The -exclude <string1:string2:...:stringN> option helps to eliminate diagnostics
for files that contain any of the strings from 1 to n in the file.
NOTE: You can use the -exclude option along with other filtering options, such as -diag,
-include, and -severity. For more information, see Report options interoperability.
The following example shows the elimination of strings from a file.
Example 6-7 Suppressing diagnostics for specific file(s)
$ cadvise report -pdb test.pdb -summary -exclude "inflate.c"
Report generated using "HP Code Advisor C.XX.XX [Release Time]" on <machine> at <Report Time>
Report command line: " cadvise report -pdb test.pdb -summary -exclude "inflate.c "
=============================== SUMMARY REPORT =================================
Unique warnings: 257
Duplicate warnings: 0
Sev. Count Diagnostic Message
--------------------------------------------------------------------------------
5 1 warning #20111-D: (SECURITY) Tainted data may be used in data length computation%s
5 4 warning #20200-D: Potential null pointer dereference %s%s is detected %s
5 10 warning #20118-D: Tainted value may be used in pointer arithmetic expression%s
5 12 warning #20112-D: (SECURITY) Tainted data may be copied to the target buffer%s
5 20 warning #20117-D: (SECURITY) Tainted value may be used in array index expression%s
5 23 warning #20114-D: (SECURITY) Tainted value may be used in loop exit condition computation%s
3 1 remark #2193-D: zero used for undefined preprocessing identifier
3 2 remark #4315-D: %s loop without body, did you insert an extra ';'?
...
6.10 Reporting Diagnostics from Specific File(s)
The -include <string1:string2:...:stringN> option generates diagnostics for files
that contain any of the strings from 1 to n in the file.
NOTE: You can use the -include option along with other filtering options, such as -exclude,
-diag, and -severity. For more information, see “Report Options Interoperability” (page 48).
The following example shows the diagnostics containing strings from 1 to n for a file.
6.9 Suppressing Diagnostics for Specific File(s) 41