The #error Conditional Directive

The #error compiler directive is used in conjunction with other conditional compilation directives to produce compile-time error messages. The compiler error messages include an argument message supplied by the developer. These directives are most useful for detecting programmer inconsistencies and violation of constraints during preprocessing. The following example demonstrates error processing during preprocessing:

#if WIDTH > MAX_WIDTH
    #error Maximum pixel resolution of 640 redefined.
#endif

Note that this error is treated as any other error; compilation of the source file will continue or terminate according to the same semantics.

Syntax

#error <message>