[comp.std.c] Extremely minor bug with enumerations

rfg@ics.uci.edu (Ronald Guilmette) (02/18/90)

In article <9002161652.AA01478@armory> kendall%saber@HARVARD.HARVARD.EDU writes:
>This file should not compile (gcc -c t.c), but does:
>
>	enum foo { a = sizeof (enum foo) };
>
>Although the ANSI draft (3.5.2.2) doesn't specify, the type `enum foo'
>should not be complete until the closing right brace.  For example, in
>an implementation that puts some enums into single bytes, the size of
>`enum foo' can't be known until after the close brace.

I believe that such code is legal, but perhaps someone with more authority
will comment.

// rfg