Deutsch English Français Italiano |
<87jzm66uiz.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: Word For Today: =?utf-8?Q?=E2=80=9CUglification=E2=80=9D?= Date: Wed, 13 Mar 2024 08:06:28 -0700 Organization: None to speak of Lines: 41 Message-ID: <87jzm66uiz.fsf@nosuchdomain.example.com> References: <uso6or$3t3jn$3@dont-email.me> <usopec$4eob$1@dont-email.me> <usort1$4t2r$1@dont-email.me> <20240312003531.349@kylheku.com> <wwvwmq7x4ex.fsf@LkoBDZeT.terraraq.uk> <usqnji$i40m$2@dont-email.me> <871q8f81wo.fsf@nosuchdomain.example.com> <wwvcyrysdyl.fsf@LkoBDZeT.terraraq.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61"; logging-data="1063452"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cKpF6p4bClLRbYcWzrXzS" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:E3axXEd7rcRx+iNUrslHUGhtwoo= sha1:U5aFhN6zrdi76NX5tR3YUnVFuBc= Bytes: 3253 Richard Kettlewell <invalid@invalid.invalid> writes: > 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. Any library from outside the implementation cannot use reserved identifiers without invoking undefined behavior, any more than ordinary user code can do so. In practice, third-party code can (probably) get away with using reserved identifiers as long as there isn't an actual collision. (A compiler could enforce a general restriction on using reserved identifiers, but I don't know of any that do so.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Medtronic void Void(void) { Void(); } /* The recursive call of the void */