HP Code Advisor

NOTE: Conflicts between +W, +Ww and +We options are resolved based on the severity. The +We
option is the highest and +W is the lowest.
Following is the syntax for disabling warnings in a macro.
$cadvise +wall -pdb <pdbname> +Wmacro:INITIAL:d1,d2,d3,..dn compile-cmd <filename>
Following is an example for disabling warnings in a macro.
Example 5-6 Disabling warnings in a macro
$cadvise +wall -pdb testpdb +Wmacro:INITIAL:600,610 cc -c foo.c
5.8 Managing Warnings in a Source File
#pragma diag_suppress | diag_warning | diag_error NNNN
#pragma diag_default NNNN
Command line options help you to generate diagnostic messages for the entire build or for a
specific source file. There are several pragmas available to manage warnings for a specific region
within a source file. The use of #pragma diag_suppress within the source code disables
generation of warning N after the pragma in the source file. The pragma diag_default restores
the default handling for the diagnostic message N. Similarly, diag_warning enables generation
of a diagnostic message and diag_error converts a warning to an error. The following example
disables warning #2549-D locally:
Example 5-7 Disabling a warning locally
int i;
#pragma diag_suppress 2549
printf ("i = %d\n", i);
#pragma diag_default 2549
NOTE: These pragmas are not applicable to warning numbers greater than 20000.
5.8 Managing Warnings in a Source File 35