🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5483

Re: trailing comma inside enum...bug or feature?

#5483
From: Henry Spencer
Date: Mon, 12 Dec 1988 17:42
21 lines
1423 bytes
In article <2174@vedge.UUCP> lai@vedge.UUCP (David Lai) writes:
>typedef enum  {
	...
>    XtGeometryDone,       /* Request accepted and done. */
>} XtGeometryResult;
>	/* note trailing comma after XtGeometryDone */
>
>elicit no complaints from any of the C compilers I use?

Probably all the C compilers you are using are PCC-derived or attempting
to be PCC-compatible.  In several contexts, the AT&T compilers are willing
to overlook a missing trailing delimiter or accept an extra trailing
separator.  The only place where this looseness actually made it into the
*documentation*, however, was the optional trailing comma in an initializer
list.  X3J11 declined to legitimize it elsewhere, so a strictly conforming
program cannot rely on it (October draft section 1.7), and a conforming
implementation must complain about use of it (2.1.1.3).  Note, however,
that a conforming implementation is not required to refuse to compile it.
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID: <1988Dec12.174256.99@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <2174@vedge.UUCP>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.windows.x
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: trailing comma inside enum...bug or feature?
Message-ID: <1988Dec12.174256.99@utzoo.uucp>
Organization: U of Toronto Zoology
References: <2174@vedge.UUCP>
Date: Mon, 12 Dec 88 17:42:56 GMT