Date: Thu, 18 Mar 2004 17:31:28 -0600 (CST) From: Archie Cobbs <archie@dellroad.org> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: freebsd-standards@FreeBSD.ORG Subject: Re: _BSD_SOURCE vs. __BSD_VISIBLE Message-ID: <200403182331.i2INVSIb005180@arch20m.dellroad.org> In-Reply-To: <200403182307.i2IN7403029016@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote: > > On FreeBSD, _BSD_SOURCE is not recognized, but _POSIX_C_SOURCE is and > > it actually causes the BSD functions to be hidden. So I have to manually > > add __BSD_VISIBLE to get them on FreeBSD. > > Then your code is wrong. If you don't want POSIX namespace, then you > shouldn't be defining _POSIX_C_SOURCE. So you're saying that _POSIX_C_SOURCE is not an additive thing, it's a restrictive thing. This is different semantics from other flags (which serve to include symbols rather than omit them), which is contributing to my confusion. E.g. _GNU_SOURCE on Linux. Are these flags documented somewhere? > > Q1: Why does Linux require _BSD_SOURCE but FreeBSD requires __BSD_VISIBLE? > > Because Linux (or more likely, glibc) made a bad decision. Can you elaborate? > > Q3: What is the right and portable set of flags to use? > > None, unless your application is prepared to live within the > limitations of the namespaces it requests. Don't ask for POSIX and > then expect something else. I want everything.. on Linux I need at least _GNU_SOURCE to get it, otherwise my compilation fails due to undeclared stuff. Why did Linux choose to arrange things so that the "default" is to not show everything? Don't just say they made a "bad decision".. they must have had some rationale, even if flawed. -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403182331.i2INVSIb005180>