From owner-freebsd-standards@FreeBSD.ORG Sat Jan 10 07:04:18 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 CE0BB16A4CE for ; Sat, 10 Jan 2004 07:04:18 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0FA543D4C for ; Sat, 10 Jan 2004 07:04:16 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id CAA14656; Sun, 11 Jan 2004 02:03:51 +1100 Date: Sun, 11 Jan 2004 02:03:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Stefan Farfeleder In-Reply-To: <20040109164241.GA596@wombat.fafoe.narf.at> Message-ID: <20040111014013.I22846@gamplex.bde.org> References: <200401081510.39015.linimon@lonesome.com> <20040110012527.S18300@gamplex.bde.org> <20040109164241.GA596@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Mark Linimon cc: freebsd-standards@freebsd.org Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour -AClipper-compatible compiler 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: Sat, 10 Jan 2004 15:04:18 -0000 On Fri, 9 Jan 2004, Stefan Farfeleder wrote: > On Sat, Jan 10, 2004 at 02:03:57AM +1100, Bruce Evans wrote: > > > - at least old standards seem to permit feature test macros to have no > > value (they may be empty, or perhaps more bizarre). The "+ 0" in the > > above is to handle this case, so that feature test with an empty value > > work the same as ones with value 0. > > [...] > > > #if _POSIX_SYNCHRONIZED_IO + 0 > 0 > > Undefined identifiers are replaced with 0 in a #if directive. Maybe > some ancient pre-C90 compilers didn't do that, but I think they can be > ignored these days. I know :-), and consider it a style bug to not depend on this feature, but the above is to handle the case where _POSIX_SYNCHRONIZED_IO is defined to be . Then "_POSIX_SYNCHRONIZED_IO > 0" would expand to " > 0", which is a syntax error. I think this possibility is fixed in POSIX.1-2001. It clearly says that the feature test constants "shall be defined with a value" if they are defined at all. POSIX.1-1990 seems to only say what happens if they are defined with a value or are undefined, leaving open the possibility that they are defined to a non-value. Hmm, POSIX.1-2001 doesn't seem to require the value to be integral, except tacitly since they would not be usable in cpp expressions if they were floating point. Bruce