Example 27 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

32 remark #4315-D: %s loop without body, did you insert an extra ';'?

...

6.10Reporting diagnostics from specific files

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 -includeoption along with other filtering options, such as -exclude, -diag, and -severity. For more information, see “Report options interoperability” (page 40).

The following example shows the diagnostics containing strings from 1 to n for a file.

Example 28 Reporting diagnostics from specific file(s).

$ cadvise report -pdb test.pdb -summary -include "inflate.c"

report: warning: Filtering options do not affect -summary and -file_summary

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 -include "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.11 Reporting program complexity metrics

The +metrics option reports the metrics in the PDB or metrics log file which is generated when the +metrics option is used during analysis. If you do not specify the +metrics option during analysis, cadvise displays the following warning:

report: warning: No metrics files specified

All options other than -includeand -excludeare ignored. The following example shows the report for program complexity data.

32 Generating reports