enums

Karl Heuer karl at haddock.ISC.COM
Thu Jul 28 01:17:42 AEST 1988


In article <1608 at dataio.Data-IO.COM> bright at Data-IO.COM (Walter Bright) writes:
>[ANSI C seems not to allow:]
>	enum abc { };		/* empty member list	*/
>	enum def { b, };	/* trailing comma	*/

I can see why one might want to allow the trailing comma, but what good is an
enum with no values?  I think this is almost in the same category as
zero-sized objects.  (I.e., the rule that allows small-valued enums to be
stored in a char could be logically extended to allow non-valued enums to be
stored in a zero-size type.)

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.std.c mailing list