From owner-freebsd-standards@FreeBSD.ORG Fri Sep 14 12:00: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 EBD1916A4A9 for ; Fri, 14 Sep 2007 12:00: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 33F3E13C4A6 for ; Fri, 14 Sep 2007 12:00: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 l8EC06qd080618 for ; Fri, 14 Sep 2007 12:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8EC057i080617; Fri, 14 Sep 2007 12:00:05 GMT (envelope-from gnats) Resent-Date: Fri, 14 Sep 2007 12:00:05 GMT Resent-Message-Id: <200709141200.l8EC057i080617@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Olaf Seibert Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFADC16A419 for ; Fri, 14 Sep 2007 11:50:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E013813C458 for ; Fri, 14 Sep 2007 11:50:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l8EBoCE9068422 for ; Fri, 14 Sep 2007 11:50:12 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l8EBoC1s068421; Fri, 14 Sep 2007 11:50:12 GMT (envelope-from nobody) Message-Id: <200709141150.l8EBoC1s068421@www.freebsd.org> Date: Fri, 14 Sep 2007 11:50:12 GMT From: Olaf Seibert To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: standards/116346: FreeBSD has no conforming C implementation X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2007 12:00:07 -0000 >Number: 116346 >Category: standards >Synopsis: FreeBSD has no conforming C implementation >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 14 12:00:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Olaf Seibert >Release: 6.1 >Organization: >Environment: FreeBSD twoquid.cs.ru.nl 6.1-RELEASE FreeBSD 6.1-RELEASE #2: Mon Mar 19 15:05:26 CET 2007 root@twoquid.cs.ru.nl:/usr/src/sys/amd64/compile/TWOQUID amd64 >Description: The following strictly conforming little C program fails to compile on FreeBSD 6.1 (and I've had the same report about FreeBSD 7). int main(int argc, char **argv) { int unix = 2; return 0; } $ uname -a FreeBSD twoquid.cs.ru.nl 6.1-RELEASE FreeBSD 6.1-RELEASE #2: Mon Mar 19 15:05:26 CET 2007 root@twoquid.cs.ru.nl:/usr/src/sys/amd64/compile/TWOQUID amd64 $ gcc c.c c.c: In function `main': c.c:3: error: syntax error before numeric constant The problem is the pre-definition of the preprocessor symbol "unix". The C standard does not allow that. Reference: ISO/IEC 9899:TC2 section 7.1.3 "Reserved Identifiers". Para 1 lists the identifiers the compiler may predefine ("reserve"). Para 2: "No other identifiers are reserved". http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf Section 4 "Conformance" para 6 says (implies) that a conforming implementation (of C) reserves no identifiers other than those explictly reserved in the C standard. Therefore, FreeBSD has no conforming C implementation. -Olaf. -- ___ Olaf 'Rhialto' Seibert -- You author it, and I'll reader it. \X/ rhialto/at/xs4all.nl -- Cetero censeo "authored" delendum esse. >How-To-Repeat: compile the above program. >Fix: Remove the predefine in the gcc build. >Release-Note: >Audit-Trail: >Unformatted: