Sujet : Re: Word For Today: “Uglification”
De : invalid (at) *nospam* invalid.invalid (Richard Kettlewell)
Groupes : comp.lang.cDate : 13. Mar 2024, 10:01:06
Autres entêtes
Organisation : terraraq NNTP server
Message-ID : <wwvcyrysdyl.fsf@LkoBDZeT.terraraq.uk>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Keith Thompson <Keith.S.Thompson+
u@gmail.com> writes:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
My specific complaint was about temporary names being used internal to
library macros. It’s a problem that is essentially impossible to solve
with string-based macro processors.
>
Here's the macro definition you cited upthread:
"""
From /usr/include/«arch»/bits/select.h on my Debian system:
>
#define __FD_ZERO(s) \
do { \
unsigned int __i; \
fd_set *__arr = (s); \
for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
__FDS_BITS (__arr)[__i] = 0; \
} while (0)
"""
>
Can you explain how that would cause a problem?
The implementation can use prefixed names as shown, so that example
won’t cause any trouble as long as the implementors coordinate amongst
themselves (which is a reasonable assumption).
Any library from outside the implementation doesn’t have that privilege
and just has to hope that the internal names it chooses don’t collide
with anything else that’s visible when its header(s) are included.
-- https://www.greenend.org.uk/rjk/