[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Designated initialization warns if struct members are
From:       "Daniel Dunbar" <daniel () zuster ! org>
Date:       2008-10-24 7:49:01
Message-ID: 6a8523d60810240049l4037630u1011d4965d5e293c () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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
>

[Attachment #5 (text/html)]

Although I can&#39;t say I&#39;m fond of adding options for this particular behavior, \
how bad would it be to put a bit in LangOptions saying &quot;dont support designated \
initializers&quot; 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).<br> <br>&nbsp;- \
Daniel<br><br><div class="gmail_quote">On Thu, Oct 16, 2008 at 10:29 PM, Chris \
Lattner <span dir="ltr">&lt;<a \
href="mailto:clattner@apple.com">clattner@apple.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d"><br>
On Oct 16, 2008, at 7:16 PM, Daniel Dunbar wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 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.<br>

<br>
Does anyone object to an error on designated initializers until it gets \
implemented?<br> </blockquote>
<br></div>
The problem with this is that it will break code that doesn&#39;t really care, such \
as the static analyzer and rewriter. &nbsp;I&#39;d be fine with codegen producing an \
error on this though. &nbsp;This would require adding a tiny bit of tracking to know \
when a designator was used though.<br> <font color="#888888">
<br>
-Chris<br>
</font></blockquote></div><br>



_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic