Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Behavior of #error preprocessor directive Keywords: preprocessor directives ANSI standard Message-ID: <14792@smoke.brl.mil> Date: 9 Jan 91 08:37:01 GMT References: <1192@van-bc.wimsey.bc.ca> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 19 In article <1192@van-bc.wimsey.bc.ca> jtc@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.