Error Directive (#error)

The #error directive causes a diagnostic message, along with any included token arguments, to be produced by HP aC++.

Syntax

error-directive ::=

#error [preprocessor tokens]

Example

//This directive will produce the diagnostic

//message "FLAG not defined!".

#ifndef FLAG

#error "FLAG not defined!" #endif

//This directive will produce the diagnostic

//message "TABLE_SIZE must be a multiple of 256!". #if TABLE_SIZE % 256 != 0

#error "TABLE_SIZE must be a multiple of 256!" #endif

Warning Directive

The #warning directive causes a diagnostic message, along with any included token arguments, to be produced by HP aC++.

Syntax

warning-directive ::=

#warning [preprocessor tokens]

Trigraph Sequences

The C++ source code character set is a superset of the ISO 646-1983 Invariant Code Set. To enable you to use only the reduced set, you can use trigraph sequences to represent those characters not in the reduced set.

A trigraph sequence is a set of three characters that is replaced by a corresponding single character. The preprocessor replaces all trigraph sequences with the corresponding character. The list below gives the complete list of trigraph sequences and their replacement characters. The following are all the trigraph sequences and their respective replacement characters:

??= is replaced by #

??/ is replaced by \

??’ is replaced by ^

??( is replaced by [

??) is replaced by ]

??! is replaced by

??< is replaced by {

??> is replaced by }

??- is replaced by ~

Examples

The line below contains the trigraph sequence ??=:

130 Preprocessing Directives