5 Configuring diagnostic messages

You may want to limit the cadvise diagnostic messages depending on the need, such as the following cases:

Generate all possible messages to ensure that you get the maximum information about potential problems detected by cadvise.

Reduce the number of messages so that you are not overwhelmed by the sheer magnitude of the warnings.

Eliminate or reduce the number of benign or misleading messages.

Your requirement may vary depending on the size of the application, resources allotted to eliminate warnings by changing source code, total number of messages generated, new or ported code, coding standards, and so on. The recommended way is to use options like, +wlint, +w64bit and +w to enable only the required warnings, and then use the options to disable specific warnings that are not of interest or that are too arbitrary. Each distinct type of diagnostic message generated by cadvise has a number associated with it. You can generate separate reports of diagnostics messages for each of these numbers. This allows you to ignore warnings that you do not want and focus on those you want.

5.1 Diagnostic configuration options table

The following options and pragmas help you to manage the diagnostics:

“+Warg1[,arg2,...,argn]” (page 25)

Selectively suppresses warnings.

“+Wwarg1[,arg2,..,argn]” (page 25)

Selectively enables warnings.

“+Wearg1[,arg2,..,argn]” (page 26)

Selectively interprets warnings as errors.

“+Wmacro:MACRONAME:d1,d2,d3,..dn” (page 26)

Disables warnings in a macro.

5.2 Suppressing warnings selectively

The +Warg1[,arg2,...,argn] option selectively suppresses any specified warning messages.

NOTE: arg1 through argn must be valid warning message numbers.

Following is the syntax for selectively suppressing warnings.

$cadvise +wall -pdb <pdbname> +Warg1[,arg2,...,argn] compile-cmd <filename>

Following is an example for selectively suppressing warnings.

Example 16 Suppressing warnings selectively

$cadvise +wall -pdb testpdb +W600 cc -c foo.c

5.3 Enabling warnings selectively

The +Wwarg1[,arg2,..,argn] option selectively enables generation of cadvise warning messages that are not enabled by default.

NOTE: arg1 through argn must be valid warning message numbers.

Following is the syntax for selectively enabling warnings.

$cadvise +wall -pdb <pdbname> +Wwarg1[,arg2,...,argn] compile-cmd <filename>

Following is an example for selectively enabling warnings.

5.1 Diagnostic configuration options table

25

Page 25
Image 25
HP UX Web Development Tools manual Configuring diagnostic messages, Diagnostic configuration options table