| Deutsch English Français Italiano |
|
<864ixavbs4.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: encapsulating directory operations
Date: Fri, 23 May 2025 22:05:31 -0700
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <864ixavbs4.fsf@linuxsc.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> <b7fb8fc41d43807641e673e1ca1d3baf69f5766f@i2pn2.org> <87iklrtcys.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 24 May 2025 07:05:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="34797294a24bb7c5bba48f4b74fba193";
logging-data="576248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jHMQ2u4dZhgfUlOTgXvD4zIMuRiA54AE="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:4B7ULIwJXVe6Db/R4k+rDhMuMVY=
sha1:NWHXi7ZpHKJEWOr54HUb54HkOZw=
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> Richard Harnden <richard.harnden@gmail.invalid> writes:
>
>> On 22/05/2025 23:32, Keith Thompson wrote:
>>
>>> "Paul Edwards" <mutazilah@gmail.com> writes:
>>>
>>>> [...]
>>>
>>> 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 <errno.h>.)
They are reserved only as macros, and only if <errno.h> 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 <errno.h> they precede the #undef's).