Sun Studio 12 Update 1: C++ User's Guide

A.2.17 -errwarn[=t]

Use -errwarn to cause the C++ compiler to exit with a failure status for the given warning messages.

A.2.17.1 Values

t is a comma-separated list that consists of one or more of the following: tag, no%tag, %all, %none. Order is important; for example %all,no%tag causes cc to exit with a fatal status if any warning except tag is issued.

The following table details the -errwarn values:

Table A–4 The -errwarn Values

Value 

Meaning  

tag

Cause CC to exit with a fatal status if the message specified by this tag is issued as a warning message. Has no effect if tag is not issued.

no%tag

Prevent CC from exiting with a fatal status if the message specified by tag is issued only as a warning message. Has no effect if the message specified by tag is not issued. Use this option to revert a warning message that was previously specified by this option with tag or %all from causing cc to exit with a fatal status when issued as a warning message.

%all

Cause CC to exit with a fatal status if any warning messages are issued. %all can be followed by no%tag to exempt specific warning messages from this behavior.

%none

Prevents any warning message from causing CC to exit with a fatal status should any warning message be issued.

Defaults

The default is -errwarn=%none. If you specify -errwarn alone, it is equivalent to -errwarn=%all.

Warnings

Only warning messages from the C++ compiler front-end that display a tag when the -errtags option is used can be specified with the -errwarn option to cause the compiler to exit with a failure status.

The warning messages generated by the C++ compiler change from release to release as the compiler error checking improves and features are added. Code that compiles using -errwarn=%all without error may not compile without error in the next release of the compiler.

See Also

-erroff, -errtags, -xwe