[cfe-dev] Designated initialization warns if struct members are not in declaration order

Chris Lattner clattner at apple.com
Thu Oct 16 22:29:43 PDT 2008


On Oct 16, 2008, at 7:16 PM, Daniel Dunbar wrote:

> 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 implemented?

The problem with this is that it will break code that doesn't really  
care, such as the static analyzer and rewriter.  I'd be fine with  
codegen producing an error on this though.  This would require adding  
a tiny bit of tracking to know when a designator was used though.

-Chris



More information about the cfe-dev mailing list