Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Help on this typedef Date: Sat, 13 May 2017 13:47:32 -0700 Organization: None to speak of Lines: 38 Message-ID: References: <7f9425fb-583a-4571-820e-bca3025172ec@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="5ca756bd95c8e8f8c29728d5fd6c16f9"; logging-data="17575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19stnitrm+aJjwNKxe8i8y/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:YYbi8u2AyGc/W84dgVMIMmpTDOw= sha1:hmLen4UwGWnrydyFBdHZP48nGA4= Xref: csiph.com comp.lang.c:109907 Tim Rentsch writes: > Keith Thompson writes: >> joel.rees@gmail.com writes: [...] >>> #error was not good enough? >> >> #error didn't exist until C99, if I recall correctly. > > C89/C90 has #error. Quite right. I should have checked before posting. (I wish I had a PDF copy of the C90 standard that wasn't scanned from a paper copy. "ansi.c.txt", a draft of the ANSI C89 standard, is useful for quick checks like this.) > What might be confusing you is that in > C99 #error requires compilation to fail, whereas in C89/C90 > all that is required is a diagnostic. No, I was simply wrong about when #error was introduced. I wasn't aware of that difference until you mentioned it. > In practical terms > I expect there is no difference, but the requirements are > slightly different in the two cases. In both cases though > a diagnostic is required. It's interesting that the C90 version of #error seems similar to the #warning directive, a common non-standard extension (and one that I wouldn't mind being standardized). But as far as I know, in most C90 compilers #error causes compilation to fail, something that's not implied by the description in the standard. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"