svn commit: r210451 - head/sys/sys

Dimitry Andric dimitry at andric.com
Sun Jul 25 19:08:33 UTC 2010


On 2010-07-25 20:12, Kostik Belousov wrote:
> I looked at the C99, and indeed, there is an explicit sentence
> "A type specifier of the form enum identifier without an enumerator list
> shall only appear after the type it specifies is complete."

Later in the same section it even has:

6. A declaration of the form
           struct-or-union identifier ;
   specifies a structure or union type and declares the identifier as a
   tag of that type. 111)

with note 111 explicitly saying: "A similar construction with enum does
not exist."


> I fully agree with Bruce that this is unfortunate, or rather, makes
> enum tag declaration completely unuseful. gcc extension greatly simplifies
> dealing with the headers pollution.

However, if you wanted to call exec_copyin_args(), you would now be
forced to remember to hand-include sys/uio.h before this header, or the
compiler would not know the enum values themselves.

You only gain something when not using that specific function (and thus
the enum) at all.  Maybe you could move just this function and the enum
declaration to another header, but that is probably overkill... :)


More information about the svn-src-head mailing list