Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Why is this happening? Date: Sun, 29 Mar 2026 10:37:23 -0700 Organization: A noiseless patient Spider Lines: 38 Message-ID: <867bqu35bg.fsf@linuxsc.com> References: <10q5046$3ec1o$2@dont-email.me> <10q523v$3e865$1@dont-email.me> <10q7bug$7vod$1@dont-email.me> <87bjg8wrgl.fsf@example.invalid> <10q7kon$aibc$2@dont-email.me> <10q85s6$fe60$1@dont-email.me> <10q8e9o$igtv$1@dont-email.me> <10q8sg1$nocf$1@dont-email.me> <10q91bf$pms8$2@dont-email.me> <10qarlj$1c51m$3@dont-email.me> <10qbgif$1mgdi$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 29 Mar 2026 17:37:26 +0000 (UTC) Injection-Info: dont-email.me; posting-host="8b6e2ad1f6d4b3e2ca51dfb376f541d7"; logging-data="1868361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ByofuOW1gIfe9Viax0il6O/61+YEtBzw=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:DIneKy1bQ5vmvCntbIAb0sJHGnw= sha1:KhmlQxYIEB6QxMZM3dS8+f2qjZw= Xref: csiph.com comp.lang.c:397273 Richard Harnden writes: > On 29/03/2026 10:33, David Brown wrote: > >> On 28/03/2026 17:58, Richard Harnden wrote: >> >>> On 28/03/2026 15:35, David Brown wrote: >>> >>>> Well, underscore basically counts as a letter, so it's a valid >>>> identifier just like "x1234" would be. Sometimes people use >>>> identifiers like that for specific purposes, like macro >>>> parameters. >>> >>> Isn't _UPPERCASE and __anything reserved for the implementation? >> >> Yes. >> >> And identifiers with _lowercase have implicit internal linkage (when >> they would otherwise have had implicit external linkage). That's >> why I wrote "underscore /basically/ counts as a letter" - to save >> mentioning all the details. > > I didn't know that, thanks. Don't believe everything you read. Of course, as far as the C standard is concerned, defining a reserved name is undefined behavior, but actual compilers have different behavior than what is suggested above. > So, at file scope, these are equivalent ... ? > static int foo; > int _foo; If you try with gcc or clang (which I did), I expect you will find that _foo is an ordinary global symbol. It does not have "implicit internal linkage". It is treated just like any other external definition.