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

Daniel Dunbar daniel at zuster.org
Fri Oct 24 00:49:01 PDT 2008

Although I can't say I'm fond of adding options for this particular
behavior, how bad would it be to put a bit in LangOptions saying "dont
support designated initializers" and only set this bit for IR generation.
This would prevent the user from seeing unrelated errors due to the
misanalysis of designated initializers, i.e. excess elements warnings and be
simpler to add (and remove).

 - Daniel

On Thu, Oct 16, 2008 at 10:29 PM, Chris Lattner <clattner at apple.com> wrote:

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081024/c5093a93/attachment.html>

More information about the cfe-dev mailing list