HP Code Advisor Reference Card

HP Code Advisor C.02.05 (cadvise)
Feedback: cadvise-help@cup.hp.com More information: www.hp.com/go/cadvise
Path
/opt/cadvise/bin/cadvise
Mode of Operation
cadvise [cadvise-options]user-compile-cmd [compiler-options]
Example Usage
Simple use of cadvise in conjunction with user builds - Only compile time checks are
performed, no cross-file analysis is done.
% cadvise cc -c file1.c
% cadvise cc -c file2.c
Enable use of program database and do cross-file analysis. Use "report" mode of cadvise
to analyze messages.
% cadvise -pdb mypdb cc -c file1.c
% cadvise -pdb mypdb cc -c file2.c
% cadvise -pdb mypdb cc file1.o file2.o
% cadvise report –pdb mypdb
Types of Checks
+wperfadvice[=1|2|3|4]
Enable performance advice.
+wsecurity [=1|2|3|4]
Enable security vulnerability checking.
+wlint
Enable lint style warnings.
+w64bit
Enable 32-bit to 64-bit porting warnings.
+wendian
Enable endianness checks.
+wall
Enable +wlint, +wsecurity, +w64bit and +wendian.
+wlock
Enable lock checks for programs using pthread based lock/unlock calls.
+metrics[=ict][:out=pdb|<filename>|+<filename>]
Emit program complexity metrics into the PDB or the file filename.
Report Generation
cadvise report <report options> -pdb <pdb location>
cadvise report <report options> <log_file1> <log_file2>...
<log_fileN>
-severity N
Print diagnostics with severity >= N. Valid values for N are 1 - 9. Highest
severity is 9 (Default value is 5).
-summary
Print summary information about all diagnostics in the log files by
severity level.
-all
Print all diagnostics in the log files sorted by the severity level.
-diag D1, D2, D3...Dn
Report messages with any of the diagnostics numbers D1 to Dn.
-file_summary
Print summary information for each source file.
+metrics[=ict]
Print program complexity data for all or selected source files.
-module <name>
Generate report only for source files that make up the module.
-exclude <string1:string2...:stringn>
Suppress printing of diagnostics from source files that have any of the
specified strings in the filename path.
-include <string1:string2:...:stringn>
Generate diagnostics from source files that contain specified strings in
the file name path.
-basepdb <basepdbname>
Generates a summary of differences between the PDB specified with -
pdb option and the basepdbname.

Summary of content (2 pages)