<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 12:08 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div><div>On Jan 23, 2013, at 11:57 AM, Daniel Dunbar <<a href="mailto:daniel@zuster.org" target="_blank">daniel@zuster.org</a>> wrote:</div>
<blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 23, 2013 at 11:44 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 11:07 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A significant part of the problem, I believe, is that there's a lot of mostly-externally-maintained C code which, at Apple, happens to need to be compiled as C++.</blockquote>


</div><br></div>FWIW, this makes perfect sense, and also makes perfect sense out of a flag to essentially get C's return semantics in a C++ compilation in order to support such code.</div></div></blockquote><div><br>

</div><div>This is still the wrong direction of the flag. I just haven't seen good justification for changing the compiler in this way to merit the possibility of breaking working code.</div></div></div></div></blockquote>
<br></div></div></div><div>Every change can break working code.  Warning changes can break working code if it's compiled with -Werror.  "Show me a whole-percentage speedup or take the optimization out" is not really a reasonable response to every last proposal.</div>
</div></blockquote><div><br></div><div style>Yes, but that doesn't mean such changes should be made without consideration either. My argument is that I do not think there is sufficient user benefit to motivate this change.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>  In LLVM and clang, we have a lot of places where we use unreachable annotations;  I think Chandler's argument is quite correct that these situations come up all the time for many users and that it's ultimately not reasonable to expect non-compiler people to use those annotations pervasively.</div>
<div><br></div><div>Our specific internal problem that makes this seem like a non-starter is that we have a pool of known code that's very awkward to fix.  We do control the build environment for that code, though.  For purposes of investigation, we can reasonably assume that any project that turns off -Wreturn-value should probably also disable the optimization.  Any stragglers can be tracked down and fixed just like we would with any other compiler change.</div>
</div></blockquote><div><br></div><div style>You are hijacking my argument. My opinion doesn't have anything to do with an internal problem, I just happen to think this is the wrong choice for users.</div><div style><br>
</div><div style>In my opinion, for *most* users and most code it is more important that the code work than that it be optimal. I think this is the kind of optimization that compiler hackers and low-level optimization people might find very desirable, but anyone writing code that depended on it should still be using an attribute or other marker.</div>
<div style><br></div><div style>Again in my opinion, for most users, the compiler is just a tool they use to get work done. They like it to optimize, and they like it to give nice warnings, but overall they want it to help them get work done and not force them to change their code.</div>
<div style><br></div><div style> - Daniel</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>John.</div></font></span></div></blockquote></div><br></div></div>