[cfe-dev] Designated initialization warns if struct members are not in declaration order
daniel at zuster.org
Thu Oct 16 19:16:14 PDT 2008
Yes, we should add this soon, its pretty bad and confusing. I would actually
prefer an error to a warning, since I would much rather deal with complaints
about clang not working than complaints about hard to find miscompilations.
Does anyone object to an error on designated initializers until it gets
On Thu, Oct 16, 2008 at 5:27 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Thu, Oct 16, 2008 at 3:50 PM, Sascha Wildner <swildner at erpicon.de>
> > "Each brace-enclosed initializer list has an associated current object.
> > When no designations are present, subobjects of the current object are
> > initialized in order according to the type of the current object: array
> > elements in increasing subscript order, structure members in declaration
> > order, and the first named member of a union. In contrast, a designation
> > causes the following initializer to begin initialization of the
> > subobject described by the designator. Initialization then continues
> > forward in order, beginning with the next subobject after that described
> > by the designator."
> Designators currently get ignored by the parser. There's been some
> discussion of how to implement it; unfortunately, it ends up being
> relatively complicated, and nobody has gotten around to it.
> It would probably be a good idea to add a warning as an interim measure,
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev