On Wed, 19 Jul 2017, Alexander Monakov wrote: > > The one and only advantage of attribute compared to Jakubs approach > > (or yours, they share the same idea of wrapping dlsym calls) is that > > it forces user to carry it around when taking address of function. > > It's an inconvenience. People won't like it when their code suddenly > stops compiling after they update libc headers. And what's the solution > for them? Adding GCC-8-specific attributes in their code, even if it > never had dlsym in tail position anyway?
Sorry, a better argument to bring up here is that dlsym is specified in POSIX which spells out the exact function prototype, so it is simply wrong to diagnose an error for standards-conforming code such as void *(*ptr)(void *, const char *) = dlsym; So Glibc could not add this attribute unconditionally, maybe only under #ifdef _GNU_SOURCE (and even then it seems like a bad idea). I'm not sure how GCC could gate it for the builtin. Alexander