comma at end of enumerator-list

Tim Roper timr at labtam.labtam.oz.au
Mon Jul 1 11:44:02 AEST 1991


I note in ANSI X3.159-1989 that

	(a) a trailing comma at the end of an enumerator-list is not allowed,
	    as in:
		enum	bletch	{
			foo,
			bar,
		};

	(b) enum tag namespace is the same as that for struct and union tags

I am trying to figure out why I previously thought otherwise.  Of course enums
were not part of K&R1.  I think it may have been the unix v7 C reference
manual that my understanding of enums was based on but I do not have access to
a copy now.  (It also covered struct arguments and returns.)

Can anyone remind me?  Does anyone know if (a) was considered an issue by X3J11
and whether it is mentioned somewhere in the Rationale?

Please note that I am not crusading but simply confused about why I
thought (a) was common usage and (b) was not true.

-Tim.



More information about the Comp.std.c mailing list