Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jul 2010 21:08:32 +0200
From:      Dimitry Andric <dimitry@andric.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder <stefanf@freebsd.org>, src-committers@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: svn commit: r210451 - head/sys/sys
Message-ID:  <4C4C8BB0.7020701@andric.com>
In-Reply-To: <20100725181255.GB22295@deviant.kiev.zoral.com.ua>
References:  <201007241814.o6OIEY4K099556@svn.freebsd.org>	<20100724183732.GA1715@mole.fafoe.narf.at>	<20100726013202.G11808@delplex.bde.org> <20100725181255.GB22295@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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... :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C4C8BB0.7020701>