HP Code Advisor C.02.25 User Guide (5900-1864, August 2012)

Contents
About this document......................................................................................5
Intended audience....................................................................................................................5
Document conventions and symbols............................................................................................5
Related information...................................................................................................................5
HP encourages your comments...................................................................................................6
1 Introduction...............................................................................................7
1.1 Cadvise user interface..........................................................................................................7
1.2 Features.............................................................................................................................7
1.2.1 Advanced static code analysis.......................................................................................8
1.2.2 Defect detection..........................................................................................................8
1.2.3 Security vulnerability checks..........................................................................................8
1.2.4 Porting and migration...................................................................................................8
1.2.5 Detection of pre-defined or user-defined coding guideline violation.....................................8
1.2.6 Easy to integrate and use..............................................................................................8
1.2.7 Supported compilers....................................................................................................9
2 Using Cadvise.........................................................................................10
2.1 Getting started..................................................................................................................10
2.1.1 Supported platforms....................................................................................................10
2.1.2 Installing Cadvise.......................................................................................................10
2.2 Steps in using cadvise.......................................................................................................10
2.3 Invoking Cadvise..............................................................................................................11
2.4 Using Cadvise as a wrapper around Compiler or Linker.........................................................12
2.5 Integrating Cadvise with the makefiles and build process.......................................................12
2.6 Enabling different categories of diagnostic messages.............................................................13
2.7 Generating code complexity metrics....................................................................................13
2.8 Detecting violation of pre-defined or user-defined coding guidelines........................................17
3 Using the Program Database (PDB).............................................................19
3.1 PDB options table..............................................................................................................20
3.2 Specifying the PDB location...............................................................................................20
3.3 Deleting PDB....................................................................................................................20
3.4 Disabling locks in PDB operations.......................................................................................20
3.5 Removing object file information from the PDB......................................................................20
3.6 Creating a PDB snapshot at a specified location...................................................................21
3.7 Displaying PDB version......................................................................................................21
4 Using cross-file analysis.............................................................................22
5 Configuring diagnostic messages...............................................................25
5.1 Diagnostic configuration options table..................................................................................25
5.2 Suppressing warnings selectively.........................................................................................25
5.3 Enabling warnings selectively.............................................................................................25
5.4 Interpreting selective warnings as errors...............................................................................26
5.5 Disabling warnings in a macro...........................................................................................26
5.6 Managing warnings in a source file....................................................................................26
6 Generating reports...................................................................................27
6.1 Report generation options table...........................................................................................27
6.2 Generating summary reports..............................................................................................28
6.3 Generating file summary report..........................................................................................28
6.4 Generating function summary report...................................................................................28
6.5 Generating detailed report.................................................................................................29
Contents 3