8 Categories of diagnostics with examples
Cadvise detects a wide range of coding errors and potential problems such as memory leaks, used after free, double free, array/buffer out of bounds access, illegal pointer access,
8.1 Categories of diagnostics table
Following are some examples of the various checks done by the HP Code Advisor:
+w | Enables all the warnings about potentially questionable constructs in the compiler. |
+wall | Enables all the compile time checks. |
“+wlint” (page 45) | Provides |
“+w64bit ” (page 51) | Enables warnings that help detection of potential problems in converting |
| applications to |
“+wendian” (page 51) | Detects code fragments which are endian dependent. |
“+wsecurity[=1234]” (page 52) Enables compile time diagnostic messages for potential security vulnerabilities.
“+wlock” (page 53) | Detects |
“+wperfadvice[=1234] | Generates performance advisory diagnostics. |
”(page 54)
•+w
This option enables all the warnings about potentially questionable constructs in the compiler. This includes the +wlint and +w64bit warnings and many others. The number of warnings generated by this option may be up to
This option enables all the warnings about potentially questionable constructs in the compiler. This includes the +wlint and +w64bit warnings and many others. The number of warnings generated by this option may be up to
Following are some examples of warnings enabled by the +w option:
-Variable is declared but never referenced
-Comparison of unsigned integer with signed integer
-Padding size of structure to alignment boundary
-Argument is incompatible with corresponding format string conversion
•+wall
The +wall option enables all the compile time checks. The +wall option includes security checks and requires
8.2Detecting generic programming errors
The compile time diagnostic messages generated by the +wlint option can be very useful in detecting potential problems in the source code. The number of warnings generated by this option may be up to
-Argument is incompatible with formal parameter
-Function declared implicitly
-Function is
8.1 Categories of diagnostics table | 45 |