3 ms·
There are lots of APIs in the world, that's true. The one with "select" in it is a staple of nearly every C program and has existed for decades. I think it wo
by jrockway 8y ago
There are lots of APIs in the world, that's true. The one with "select" in it is a staple of nearly every C program and has existed for decades. I think it would be wise to name your stuff so as not to collide with it.
If someone someday makes a name that collides with yours, that's a problem for that "someday". Avoiding today's problem today seems pretty valuable.
- kazinator 8y agoThanks, 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]