3 ms·
Thanks, I am quite well informed in this sort of debate. POSIX systems in fact go out of their way to support conforming ISO C programs, which are permitted to
by kazinator 8y ago
Thanks, I am quite well informed in this sort of debate.
POSIX systems in fact go out of their way to support conforming ISO C programs, which are permitted to contain things like:
void select(int x) // not in any ISO C reserved namespace!
{
selection = x;
}
In the case of the GNU C library how it works is that select is a weak symbol aliasing for __select. If anything in the library needs to use select, it calls __select, so as not to be derailed by a user program that redefines the weak symbol.
Issues with macros are less severe compared to clashes in actual external linkage. No weak symbol support needed in shared libs; just something has to be #undef-ed here, or an order of headers rearranged there.
- deleted 8y ago[deleted]