Path: csiph.com!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.std.c Subject: Re: Invalid sample definition for errno Date: Sun, 20 Nov 2022 13:58:27 -0800 Organization: None to speak of Lines: 30 Message-ID: <87edtxl24c.fsf@nosuchdomain.example.com> References: <87r0xyl6nm.fsf@nosuchdomain.example.com> <86sfidbvu7.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader01.eternal-september.org; posting-host="542c9bd86dcad9131c7660300d8ef3f5"; logging-data="3792105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IYYPkv0D7oghrj7tAiYKE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:7l7JWuwk5MSVAjQci6c+ZTAabYc= sha1:y4DiyyYSb0R5ra7VckmhVMeojsw= Xref: csiph.com comp.std.c:6453 Tim Rentsch writes: > Keith Thompson writes: >> A footnote in the section describing says: >> >> The macro errno need not be the identifier of an object. It might >> expand to a modifiable lvalue resulting from a function call (for >> example, *errno()). >> >> Footnotes are non-normative, and this one is presumably intended to be >> informal, but that's not a valid macro definition for errno, both >> because it's not fully protected by parentheses and because the function >> can't be named "errno". > > I see no reason the function couldn't be named "errno". My thought was that giving the function and the macro the same name would cause a conflict, and I thought I had an example that demonstrated it. Looking again, I was mistaken: If the name of the macro being replaced is found during this scan of the replacement list (not including the rest of the source file’s preprocessing tokens), it is not replaced. I still suggest that using the same name for both is needlessly confusing. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */