On Fri, Apr 3, 2015 at 3:24 PM, Todd C. Miller
<[email protected]> wrote:
> On Fri, 03 Apr 2015 15:17:59 -0700, Philip Guenther wrote:
>
>> ** it would only help someone building with something like "cc
>> -D_POSIX_C_SOURCE=199506 -D_BSD_SOURCE=1" which, IMHO, is insane.
>
> Why is it insane to want a specific POSIX version plus BSD extensions?

*Given* that OpenBSD, as you say, always exposes the latest POSIX APIs
by default, what problem is that combination supposed to solve that is
not already solved by just using the default?

It doesn't prevent namespace pollution, and the set exposed by the
-D_BSD_SOURCE=1 continues to evolve and grow in what POSIX considers
the application namespace.  All it does is lop of some (but not all!)
POSIX additions between then and now.  What problem does that solve?


> There are two ways to use things like _POSIX_C_SOURCE.
>
> 1) *Only* expose interfaces defined by a specific version of the spec
>
> 2) Expose all interfaces defined by a specific version of the spec,
>    even if they are not exposed by default.
>
> Since we always expose the latest POSIX APIs by default #1 is what
> we think about.  However, there are other systems that *only* expose
> some APIs when _POSIX_C_SOURCE is defined (I'm looking at you
> Solaris).  On those systems it is not uncommon to define _POSIX_C_SOURCE
> in addition to another symbol to expose non-POSIX extensions.

Sure, on Solaris you have to use "-D_XOPEN_SOURCE=700 -D__EXTENSIONS__
-D_REENTRANT" and hope, but that's because they have a API compat
promise that includes the compilation environment.  We don't have that
problem and don't need that solution.


Philip Guenther

Reply via email to