From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 19 09:11:32 2006 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8463316A406; Wed, 19 Apr 2006 09:11:32 +0000 (UTC) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC18E43D6D; Wed, 19 Apr 2006 09:11:20 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm513-1.comsys.ntu-kpi.kiev.ua (pm513-1.comsys.ntu-kpi.kiev.ua [10.18.52.101]) (authenticated bits=0) by comsys.ntu-kpi.kiev.ua (8.13.6/8.13.6) with ESMTP id k3J9Peij008342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 19 Apr 2006 12:25:40 +0300 (EEST) Received: by pm513-1.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1001) id 9D5205C024; Wed, 19 Apr 2006 12:11:41 +0300 (EEST) Date: Wed, 19 Apr 2006 12:11:41 +0300 From: Andrey Simonenko To: Jim Rees Message-ID: <20060419091141.GA1176@pm513-1.comsys.ntu-kpi.kiev.ua> References: <200604181946.k3IJkTST078339@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200604181946.k3IJkTST078339@freefall.freebsd.org> User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,AWL autolearn=unavailable version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on comsys.ntu-kpi.kiev.ua X-Virus-Scanned: ClamAV 0.82/1390/Tue Apr 11 10:32:32 2006 on comsys.ntu-kpi.kiev.ua X-Virus-Status: Clean Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/95987: [patch] nfsproto.h has trailing ',' in enums X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 09:11:32 -0000 On Tue, Apr 18, 2006 at 03:46:29PM -0400, Jim Rees wrote: > Synopsis: [patch] nfsproto.h has trailing ',' in enums > > State-Changed-From-To: open->closed > State-Changed-By: rees > State-Changed-When: Tue Apr 18 15:41:22 EDT 2006 > State-Changed-Why: > This is explicitly allowed by ANSI C "Enumeration specifiers" which > says that an enumerator-list may be followed by a comma. Not a bug. > I have only drafts of c89, c99 and c++98 and looks like, that trailing comma in enum is c99 addition. c89 3.5.2.2 Enumeration specifiers c99 6.7.2.2 Enumeration specifiers c++89 7.2 Enumeration declarations http://david.tribble.com/text/cdiffs.htm#C99-enum-decl Simple program: enum { a, }; int main(void) { return 0; } Results from GCC 3.4.4 and TenDRA 4.0 compilers on 6.1-RC/i386: % gcc -ansi -pedantic a.c a.c:3: warning: comma at end of enumerator list % gcc -std=c99 a.c % g++ a.cc % g++ -pedantic a.cc a.cc:3: error: comma at end of enumerator list % tcc -Yansi a.c "a.c", line 3: Error: [Syntax]: Extra comma at end of list. % tcc -Yc++ a.cc "a.c", line 3: Error: [Syntax]: Extra comma at end of list. % tcc -Yc99 a.c (I do not know equivalent for -pedantic for g++)