Sujet : Re: encapsulating directory operations
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 23. May 2025, 18:22:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250523102010.465@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-05-23, Richard Heathfield <
rjh@cpax.org.uk> wrote:
On 23/05/2025 16:09, Richard Harnden wrote:
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?
>
7.26.3 (in 9899:1999) reads: 'Macros that begin with E and a
digit or E and an uppercase letter may be added to the
declarations in the <errno.h> header.'
Standardization has often introduced identifers that were not in any
previously announced namespaces.
If the spec said, "in the future, we may add any identifier of any kind
to any header, beginning with any letter (upper or lower case)
or underscore", I wouldn't stop programming.
Name clashes are like moles in the whack-a-mole game. Whack them when
they rear their heads.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca