On Mon, 3 Mar 2014, Eric Blake wrote:
On 03/01/2014 08:32 PM, Fredrik Tolf wrote:
I read what you write kind of as if systems shouldn't expose anything
non-POSIX as long as it isn't used, but this is clearly not the case;
not only with funopen() on *BSD, but also with e.g. epoll() on
GNU/Linux, or just such things as GCC C extensions.

How do you get epoll() on GNU/Linux?  By including <sys/epoll.h>, but
that's a header that is not mentioned in POSIX.

True enough, my bad.

I guess my interpretation should be, then, that the default environment is not so much about strictly hiding everything which is not in POSIX, but rather about not breaking anything which should be valid under POSIX, for example by not defining potentially conflicting symbols. That makes sense, and also explains why GCC C extensions need not be explicitly hidden in the default environment.

Relying on the "default environment" is risky - something that might be polluted into the namespace today could disappear tomorrow if the system headers get patched to provide less pollution. Explicitly requesting extensions is the only way to ensure that your program that takes advantage of the extensions will not be broken by changes to the default mode.

Yes, I see your point now, and I think I finally understand why AC_USE_SYSTEM_EXTENSIONS is all about.

Thanks a lot for the explanation!

--
Fredrik Tolf

_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to