### #error Preprocessor Directive

A preprocessor error directive causes the preprocessor to generate a severe (S) compile-time diagnostic error message. Preprocessing continues, but no object code is generated.

Use the #error directive as a safety check during compilation. For example, if your program uses preprocessor conditional compilation directives, put #error directives in the source file to prevent code generation if a section of the program is reached that should be bypassed.

For example, the directive

    #error Error in TESTPGM1 - This section should not be compiled

generates the following error message:

    Error in TESTPGM1 - This section should not be compiled

Preprocessor Directives

List of Preprocessor Directives