Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: encapsulating directory operations Date: Sat, 24 May 2025 01:27:46 -0700 Organization: None to speak of Lines: 39 Message-ID: <87plfys9a5.fsf@nosuchdomain.example.com> References: <100h650$23r5l$1@dont-email.me> <20250520065158.709@kylheku.com> <100i2la$292le$1@dont-email.me> <87a5770xjw.fsf@nosuchdomain.example.com> <100j09o$2f04b$1@dont-email.me> <87tt5ezx9y.fsf@nosuchdomain.example.com> <100j4t3$2foah$1@dont-email.me> <87ldqqzfj0.fsf@nosuchdomain.example.com> <100kak8$2q0s6$1@dont-email.me> <87a575zvmb.fsf@nosuchdomain.example.com> <100o3sc$3ll6t$1@dont-email.me> <87bjrkxonr.fsf@nosuchdomain.example.com> <87iklrtcys.fsf@nosuchdomain.example.com> <864ixavbs4.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 24 May 2025 10:27:49 +0200 (CEST) Injection-Info: dont-email.me; posting-host="0ba1c539592a7bdafac6a495dcd9bfcd"; logging-data="642450"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dlYgIrbIsL1rY4N5exZtu" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:opTyHqCAap2mowN+w+Ry/CBc9p4= sha1:hmBby23Uvw5NfEIhpy5poaHLTFw= Xref: csiph.com comp.lang.c:393587 Tim Rentsch writes: > Keith Thompson writes: >> Richard Harnden writes: >>> On 22/05/2025 23:32, Keith Thompson wrote: [...] >>>> In one of your library's headers: >>>> extern const char ESCAPE; >>>> In the corresponding *.c file: >>>> const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27'); >>>> Change the name if you prefer. >>> >>> Wouldn't that be a reserved identifier? >> >> Yes, it would. Good catch. >> >> (Identifiers starting with E followed by either a digit or an uppercase >> letter are reserved; they could be defined as macros in .) > > They are reserved only as macros, and only if has > been #include'd. > > For this particular use, it's easy to make the definition work, > simply by adding > > #undef ESCAPE > > before the declaration in the header file, and before the > definition in the source file (assuming of course that if > there are any #include they precede the #undef's). It would be even easier to pick a different name. If I had a time machine and sufficient influence, I might make all the errno macros start with something more distinct, like E_ or ERR. But I don't. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */