HP Code Advisor

Table of Contents
About This Document.........................................................................................................9
Intended Audience.................................................................................................................................9
Document conventions and symbols......................................................................................................9
Related Information................................................................................................................................9
HP Encourages Your Comments..........................................................................................................10
1 Introduction...................................................................................................................11
1.1 Cadvise User Interface....................................................................................................................11
1.2 Features...........................................................................................................................................11
1.2.1 Advanced Static Code Analysis..............................................................................................12
1.2.2 Defect Detection......................................................................................................................12
1.2.3 Security Vulnerability Checks.................................................................................................12
1.2.4 Porting and Migration.............................................................................................................12
1.2.5 Detection of Pre-defined or User-defined Coding Guideline Violation.................................12
1.2.6 Easy to Integrate and Use........................................................................................................12
1.2.7 Supported Compilers..............................................................................................................13
2 Using Cadvise..............................................................................................................15
2.1 Getting Started.................................................................................................................................15
2.1.1 Supported Platforms...............................................................................................................15
2.1.2 Installing Cadvise....................................................................................................................15
2.2 Steps in Using Cadvise....................................................................................................................15
2.3 Invoking Cadvise.............................................................................................................................16
2.4 Using Cadvise as a Wrapper around Compiler or Linker..............................................................17
2.5 Integrating Cadvise with the Makefiles and Build Process............................................................17
2.6 Enabling Different Categories of Diagnostic Messages..................................................................18
2.7 Generating Code Complexity Metrics.............................................................................................18
2.8 Detecting Violation of Pre-defined or User-defined Coding Guidelines........................................22
3 Using the Program Database (PDB)...........................................................................25
3.1 PDB Options Table..........................................................................................................................26
3.2 Specifying the PDB location............................................................................................................26
3.3 Deleting PDB...................................................................................................................................26
3.4 Disabling locks in PDB operations..................................................................................................26
3.5 Removing Object File Information from the PDB...........................................................................27
3.6 Creating a PDB Snapshot at a Specified Location...........................................................................27
3.7 Displaying PDB Version..................................................................................................................27
4 Using Cross-File Analysis.............................................................................................29
5 Configuring Diagnostic Messages.............................................................................33
5.1 Diagnostic Configuration Options Table.........................................................................................33
5.2 Suppressing Diagnostics from Specific File(s)................................................................................33
5.3 Emitting Diagnostics from Specific File(s)......................................................................................33
5.4 Suppressing Warnings Selectively..................................................................................................34
5.5 Enabling Warnings Selectively........................................................................................................34
5.6 Interpreting Selective Warnings as Errors.......................................................................................34
Table of Contents 3