Sujet : Re: Word For Today: “Uglification”
De : 433-929-6894 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 14. Mar 2024, 02:40:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240313172324.87@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-03-13, Keith Thompson <Keith.S.Thompson+
u@gmail.com> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Wed, 13 Mar 2024 22:33:02 GMT, Scott Lurndal wrote:
Third party libraries are allowed to use any mechanism they like to
minimize name conflicts other than prefixing with two underscores.
>
But there is no other such mechanism available.
>
Are you aware that working third party libraries exist, and name
collisions are fairly rare? How do you think that's possible?
It's possible because firstly, even if there are collisions latent
in the library mixture, not all libraries are used together in one
application. E.g. in an OS distro installation there might be a thousand
libraries, but no application uses all thousand.
Secondly, even if two libraries are used in the same application, where
those libraries have a header-file-level clash, the clash only occurs if
their headers are included in the same translation unit in that program.
Thirdly, mere linkage of two libraries into the same program can only
cause a clash if it involves an external name.
Fourth, even if two libraries have a clashing external name, I think
that under certain dynamic linking paradigms, this is only a problem if
that name is used. If the same name refers to multiple entities, there
is an ambiguity, but if the program doesn't use that name, then the
ambiguity doesn't matter.
Fifth, if we are talking specifically about names used by macros for
naming local symbols inserted into the program, libraries not in the C
implementation in fact can get away with using the __ space. If these
identifiers don't land on a compiler keyword, there is no actual
problem. Now a third party library could choose such a name inside its
macro such that the C library has also used the same name inside its
macro. But for that to cause a clash, the macros have to be nested
together.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca