| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsError Handling |
|
Use the following options to control how potential errors in your code are detected and handled. You can also use the cadvise report feature of the HP Code Advisor tool to help analyze compiler errors and warnings. The +p option disallows all anachronistic constructs. Ordinarily, the compiler gives warnings about anachronistic constructs. Using the +p option, the compiler gives errors for anachronistic constructs. Example: The following command compiles file.C and gives errors for all anachronistic constructs rather than just giving warnings. aCC +p file.C The -w option suppresses all warning messages. By default, the compiler reports all errors and warnings. Example: The following command compiles file.C and reports errors but does not report any warnings. aCC -w file.C The +w option warns you about all questionable constructs and gives pedantic warnings. +w enables all checks except for the +wsecurity and +wendian warnings. Those need to be enabled explicitly if needed. The default is to warn only about constructs that are almost certainly problems. For example, this option warns you when calls to inline functions cannot be expanded inline. The following command compiles file.C and warns about both questionable and problematic constructs: aCC +w file.C
The +wn option specifies the level of the warnings messages. +w{1|2|3} The value of n can be one of the following:
+Warg1[,arg2,..argn] The +Wargs option selectively suppresses any specified warning messages. Arguments arg1 through argn are valid compiler warning message numbers. Example: aCC +W600 app.C +We The +We option interprets all warning and future error messages as errors. Alternatively you can also use +We[arg1,...argn] option, where arg is a valid compiler warning message number. Use of arg is optional. +Wearg1[,arg2,..,argn] The +Weargs option selectively interprets any specified warning or future error messages as errors. arg1 through argn are valid compiler warning message numbers. Example: aCC +We 600,829 app.C +Wwarg1[,arg2,..,argn] The +Wwargs option selectively treats compiler remarks or discretionary errors as warnings. arg1 through argn are valid compiler message numbers. Conflicts between +W, +Ww and +We are resolved based on their severity. +We is the highest and +W is the lowest. This option enables several warnings in the compiler that provide lint like functionality. Checks are made for memory leaks, out-of-scope memory access, null pointer dereference, and out-of-bounds access. These compile time diagnostics can be very useful in detecting potential problems in the source code. To disable a specific warning introduced by +wlint, a +Wargs option can be used after the +wlint option.
This option enables compile time diagnostics for potential security violations. Warnings are emitted for cases where untrusted (tainted) data may reach a critical reference point in the program. This is based on cross-module analysis performed by the compiler. Hence the +wsecurity option implicitly enables a limited form of cross-module analysis, even if -ipo or +O4 options are not specified. This may lead to a significant increase in the compile time compared to a build without the +wsecurity option. Using this option may result in the compiler invoking optimizations other than those that are part of the user-specified optimization level. If +wsecurity is used in addition to -ipo or +O4, the generated code is not affected and the compile time does not significantly increase. This option can optionally take an argument to control how verbosely the security messages are emitted: +wsecurity[={1|2|3|4}] The higher the check level, the more warnings can be generated. Note that this may also generate more false positives. The default level is 2. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||