From owner-freebsd-standards@FreeBSD.ORG Thu Mar 18 15:32:02 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC16816A4CE for ; Thu, 18 Mar 2004 15:32:02 -0800 (PST) Received: from STVAVAPPL1.BHMSTV (unknown [207.203.42.3]) by mx1.FreeBSD.org (Postfix) with SMTP id 7508D43D1D for ; Thu, 18 Mar 2004 15:32:02 -0800 (PST) (envelope-from archie@dellroad.org) Received: from unknown(10.104.180.64) by STVAVAPPL1.BHMSTV via csmap id 24fe0344_7933_11d8_8538_00304811e8c8_31068; Thu, 18 Mar 2004 17:22:37 -0600 (CST) Received: from arch20m.dellroad.org (localhost [127.0.0.1]) i2INVTCm005181; Thu, 18 Mar 2004 17:31:29 -0600 (CST) (envelope-from archie@arch20m.dellroad.org) Received: (from archie@localhost) by arch20m.dellroad.org (8.12.9p2/8.12.9/Submit) id i2INVSIb005180; Thu, 18 Mar 2004 17:31:28 -0600 (CST) (envelope-from archie) From: Archie Cobbs Message-Id: <200403182331.i2INVSIb005180@arch20m.dellroad.org> In-Reply-To: <200403182307.i2IN7403029016@khavrinen.lcs.mit.edu> To: Garrett Wollman Date: Thu, 18 Mar 2004 17:31:28 -0600 (CST) X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: freebsd-standards@FreeBSD.ORG Subject: Re: _BSD_SOURCE vs. __BSD_VISIBLE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 23:32:02 -0000 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