From owner-freebsd-standards@FreeBSD.ORG Fri Sep 14 13:40:06 2007 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88EB16A41A for ; Fri, 14 Sep 2007 13:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C3AA113C461 for ; Fri, 14 Sep 2007 13:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8EDe6fV089884 for ; Fri, 14 Sep 2007 13:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8EDe6BN089882; Fri, 14 Sep 2007 13:40:06 GMT (envelope-from gnats) Date: Fri, 14 Sep 2007 13:40:06 GMT Message-Id: <200709141340.l8EDe6BN089882@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Rhialto Cc: Subject: Re: standards/116346: FreeBSD has no conforming C implementation X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rhialto List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2007 13:40:06 -0000 The following reply was made to PR standards/116346; it has been noted by GNATS. From: Rhialto To: Erik Trulsson Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: standards/116346: FreeBSD has no conforming C implementation Date: Fri, 14 Sep 2007 15:35:06 +0200 On Fri 14 Sep 2007 at 14:44:50 +0200, Erik Trulsson wrote: > Yes, it does. You do however have to invoke the C compiler in > standard-conforming mode. > By default gcc (like most C compilers) is not in standards-conforming mode. > > Try invoking it as 'gcc -ansi' or 'c89' to get a C compiler conforming to > the 1989 ANSI C standard. (Invoking it as 'c99' or as 'gcc -std=c99' should > get a C99 compiler, although I believe support for the 1999 C standard is > not quite complete.) Of course no makefile project ever does that at all, in practice, yet they still expect to have the promised namespace available for their own identifiers. I was made aware of this problem when some project was using the "unix" preprocessor definition as a feature test, and it failed to build on a different BSD system, which IMHO is more correct in this regard. I don't know where to look this up in POSIX and related standards, but I don't expect that any of them actually *requires* a pre-#defined unix, since they most likely don't want to contradict the C standard. If they would mention any such feature test at all, they would require #inclusion of some specific header first, or use a name which is reserved to the implementation, such as __unix__. Otherwise, by your reasoning, the default-invoked compiler could do anything, and you would not need to bother having all those __-prefixed names in /usr/include/sys/*. Therefore, there is no standards-related reason for having "unix" and I still argue for removing it. -Olaf. -- ___ Olaf 'Rhialto' Seibert -- You author it, and I'll reader it. \X/ rhialto/at/xs4all.nl -- Cetero censeo "authored" delendum esse.