Xref: utzoo comp.std.c:551 comp.windows.x:6619 Newsgroups: comp.std.c,comp.windows.x Path: 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 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