Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line Options

Error Handling

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Use these options to control how potential errors in your code are detected and handled.

+p

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

-w

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

+w

The +w option warns you about all questionable constructs, as well as constructs that are almost certainly problems. 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

NOTE: This option is equivalent to the +w1 option of legacy HP C.

+wn

The +wn option specifies the level of the warnings messages.

+w{1|2|3}

The value of n can be one of the following:

1

All warnings are issued. This includes low level warnings that may not indicate anything wrong with the program.

2

Only warnings indicating that code generation might be affected are issued. This is equivalent to the compiler default without the -w options.

3

No warnings are issued. This is equivalent to the -w option. This option is the same as -W c and-wn.

+Wargs

+Warg1[,arg2,..argn]

The +Wargs option selectively suppresses any specified warning messages.

arg1 through argn are valid compiler warning message numbers.

Example:

aCC +W600 app.C

+We

+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.

+Weargs

+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

+Wwargs

+Wwarg1[,arg2,..,argn]

The +Wwargs option selectively treats compiler suggestions and remarks 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.