User's Manual
Example 43 Generating a consolidated cadvise report from multiple PDBs
$ cadvise report -pdb 1.pdb:2.pdb:3.pdb:4.pdb -all
Report generated using "HP Code Advisor C.XX.XX [Release Date]" on <Machine Name> at <Time>
Report command line: "Report Command Line"
=============================== DETAILED REPORT ================================
------------------------------- SEVERITY LEVEL 8 -------------------------------
"/home/rajen/cadvise/testing/1.c", line 5: warning #2549-D: variable "p" is used before its value is set
y = *p = 1;
^
"/home/rajen/cadvise/testing/4.c", line 5: warning #2549-D: variable "c" is used before its value is set
a = b = c;
^
------------------------------- SEVERITY LEVEL 5 -------------------------------
"/home/rajen/cadvise/testing/2.c", line 4: warning #2223-D: function "scanf" declared implicitly
scanf("%d",&a);
^
"/home/rajen/cadvise/testing/3.c", line 7: warning #2223-D: function "printf" declared implicitly
printf("%d\n", y);
^
"/home/rajen/cadvise/testing/1.c", line 5, procedure main: warning #20200-D: Potential null pointer dereference
through p is detected (null definition:/home/rajen/cadvise/testing/1.c, line 2)
6.19 Generating PDB diffs with multiple PDBs
Just as using multiple PDBs to get a consolidated report, PDB diff can also support multiple PDBs.
A sample command for PDB diff with multiple PDBs will be as follows:
$ cadvise report -pdb pdb1:pdb2:pdb3:... -basepdb
basepdb1:basepdb2:basepdb3:...
6.20 Recommended process for analyzing the diagnostic messages
The recommended process for analyzing the diagnostic messages is as mentioned below:
1. See a summary report using cadvise report. This gives an overview of the diagnostic
messages that have been generated for the application.
2. Analyze all high severity ( >= 7) diagnostic messages generated by cadvise. These diagnostic
messages have a very low false positive rate and are likely to point out defects in the
application.
3. Each distinct type of diagnostic message generated by the code advisor has a number
associated with it. From the summary, identify particular diagnostic messages that are of
importance to the application, and then generate a detailed report only for those diagnostic
messages. This allows you to focus on a few selected diagnostic messages.
4. Individual developers can analyze the diagnostic messages generated for a particular portion
of the code by filtering the report for a particular set of files. This can be done using
-file_summary and -file options.
6.21 Report options interoperability
Filtering options such as -diag, -exclude, -include, and -severity can be used with one
another to generate a report filtered on the criterion.
NOTE: These filtering options are ignored when used with -all, -summary, and
-file_summary options. However, the -all and -severity options can be used together to
create a detailed report of diagnostics with severity above the specified severity level.
The following examples shows the usage of multiple options simultaneously.
40 Generating reports