Xref: utzoo comp.lang.c:31243 comp.std.c:3501 Path: utzoo!attcan!uunet!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.lang.c,comp.std.c Subject: Re: enum, no trailing comma? Message-ID: Date: 20 Aug 90 14:03:13 GMT References: <8@christmas.UUCP> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 45 In-reply-to: rtm@christmas.UUCP's message of 17 Aug 90 18:35:58 GMT In article <8@christmas.UUCP> rtm@christmas.UUCP (Richard Minner) writes: | Is it just my eyes or does: | | (From December 7, 1988 DRAFT) | 3.5.2.2 Enumeration specifiers | | Syntax | : | enum _opt { } | enum | | : | | , | | : | | = | | mean that a trailing comma: | enum foo { one, two, three, }; | is disallowed? Yes, trailing commas are not allowed for enum lists. | If it really is disallowed, why? It seems out of place, since | trailing commas are ok in array and struct initializers. Why so | nitpicky here? (gcc ignores the trailing comma unless you | specify -pedantic.) Are compiler vendors likely to consider such | a comma a real live syntax error? I suppose they have to. | (Maybe it was just too hard to specify the syntax to allow a | trailing comma? :-) The original implementation of enum's also required a comma (or least the documentation did not document that missing commas were allow, and I don't have the source on-line), and ANSI reflects that. My recollection is it came up, but there was not enough sentiment to add it. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Do apple growers tell their kids money doesn't grow on bushes?