Liste des Groupes | Revenir à l c |
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:
>>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).
Les messages affichés proviennent d'usenet.