<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Another case where the warning might not be desired is if a class overloads operator new and initializes its allocation itself?</div><br><div><div>On Apr 9, 2012, at 4:26 PM, Evan Wallace wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Mon, Apr 9, 2012 at 3:54 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jediknil@belkadan.com">jediknil@belkadan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I like this idea, though like David said it might not be great for all projects. I think it should be off for POD structs, though, like your first example:<br>
<div class="im"><br>
> // warning about a<br>
> struct A { int a; };<br>
<br>
</div>I think fewer people mistakenly expect POD structs to be initialized, and of course initializing 'a' would make the struct no-longer POD. The issues I've come across while working with Clang are always POD members in non-POD structures. What do you think?</blockquote>

</div><br><div>That makes a lot of sense, especially for compiling C-like code. I like that much better. I've updated my patch with test cases and a check for POD types. I'm still not sure where to put this diagnostic. It's tentatively in a new warning called -Wuninitialized-member in the -Wextra group. Is that the best place for it, or would it fit better somewhere else?</div>

<div><br></div><div>- Evan</div>
<span><Wuninitialized-member.diff></span>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>