From owner-freebsd-standards Thu Nov 29 2:57: 3 2001 Delivered-To: freebsd-standards@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 00BC637B425; Thu, 29 Nov 2001 02:56:59 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA23458; Thu, 29 Nov 2001 21:56:55 +1100 Date: Thu, 29 Nov 2001 21:56:58 +1100 (EST) From: Bruce Evans X-X-Sender: To: Mike Barcroft Cc: Wes Peters , Bruce Evans , Subject: Re: cvs commit: src/include string.h In-Reply-To: <20011129041735.F15672@espresso.q9media.com> Message-ID: <20011129213259.D1261-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 29 Nov 2001, Mike Barcroft wrote: [moving declaration of strerror_r() to the "nonsstandard" section] > As Bruce's commit message suggests, this is only temporary. I think > we need something along the lines of: > > #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) > #if _POSIX_C_SOURCE >= 200111L /* XXX */ > ... > #endif > #endif > > ...to properly protect new POSIX functions. Broken down, this means > something like "only prototype this function if we aren't using C90, > POSIX.1, POSIX.1-88, POSIX.1-90, or POSIX.1-96". I'm unsure whether > we care if POSIX.1-200x functions leak into C99. I care a bit. The above ifdef should probably be changed to something like #if _POSIX_VISIBLE >= 200111 ... #endif where _POSIX_VISIBLE is define according to the settings of _POSIX_C_SOURCE, _ANSI_SOURCE, _POSIX_SOURCE and other "feature test" (enable, disable, or actually test) macros. See wollman's old patches. Note that it is the application's responsibility to set _POSIX_C_SOURCE. Setting it is supposed to give precisely the interfaces specified by the POSIX standard of the given data, modulo other feature test mac(this is usually a restriction). Not setting it should give everything if no other feature disable macros are set. There is no standard macro like _POSIX_C_SOURCE for C99. We would need a new macro like _ANSI_SOURCE to support restriction to C99 features. Name it something like _C99_SOURCE (it's hard to think of a name as non-descriptive as _ANSI_SOURCE). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message