Behavior of #error preprocessor directive
Doug Gwyn
gwyn at smoke.brl.mil
Wed Jan 9 19:37:01 AEST 1991
In article <1192 at van-bc.wimsey.bc.ca> jtc at van-bc.wimsey.bc.ca (J.T. Conklin) writes:
>Is use of the #error preprocessor directive required (or permitted) to
>halt compilation of a source module.
#error produces a diagnostic message, nothing more.
>In any case, was anything like my #warning directive discussed during
>the standardization process?
Yes. We spelled it #error, though.
Note that code intended to be compiled (with appropriate conditionalizing)
by both ANSI and pre-ANSI compilers should not use #error, because many
pre-ANSI C preprocessors would terminate fatally upon seeing #error, even
in #ifed-out source code. Thus I tend to still use the kludge
#if SOME_EXPR
#include "*** ERROR -- SOME_EXPR ***"
#endif
which has a more drastic effect than #error anyway.
More information about the Comp.lang.c
mailing list