Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Question about #error Date: Sat, 30 Mar 2019 15:19:49 -0700 Organization: None to speak of Lines: 41 Message-ID: References: <9183709e-58d4-47b5-9e2b-781600729a55@googlegroups.com> <167a6806-9b54-4b29-bd00-188e286d3c05@googlegroups.com> <554d9166-d9ca-4109-b40e-a79b6f14ac41@googlegroups.com> <41ad852c-4691-43dc-ae82-616efd8b1d83@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="fa6adea375648786e8bbf574d232b112"; logging-data="11863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188hQ7F9z9Hey7vPPggzeH6" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0hJ8pG6BOEaznUdXqFsbhNFExcc= sha1:curvnHrMZltSvliyTPPh7nXPDOI= Xref: csiph.com comp.lang.c:142623 Thiago Adams writes: > On Friday, March 29, 2019 at 12:05:53 PM UTC-3, James Kuyper wrote: > ... >> #if expressions are evaluated during translation phase 4. Per the rules >> currently in effect, sizeof(int) gets converted into 0(0) before >> evaluation (6.10.1p4), resulting in a syntax error. > > > Does anyone uses or find uses of identifiers not defined in > #if expressions? > > Like > #if IDENTIFIER > > and IDENTIFIER was never #defined. > The normal usage is > #if defined(X) or > #if X > where X is defined as 1 or 0 > > > I did a search in windows include directory for #if identifier > and I didn't find any usage where identifier was not defined. > > I think this behavior could be deprecated and generate warning > or error. The meaning of #if UNDEFINED_IDENTIFIER is currently well defined. Treating it as a fatal error could easily break existing code. (A Windows include directory is not likely to be a representative sample.) What would be the advantage of deprecating it? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */