<div dir="ltr"><div>Not all code needs to be moved between compilers.</div><div><br></div><div>That having been said, if my proposal were implemented, you would still be perfectly free to tell people 'you're doing it wrong, you shouldn't actually depend on things the standard doesn't cover' (even though in practice, people use compiler extensions, system specific code and suchlike all the time, and nobody seems to think this is a reason such things shouldn't be provided).</div><div><br></div><div>Even if you want to have the compiler warn at compile time about code that depends on undefined behaviour (in cases where it can deduce that such is occurring), that's okay.</div><div><br></div><div>But having programs miscompiled so that they silently fail, in many cases starting only years after the code in question was written, is very much not okay. That's far worse than documented portability problems.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 1, 2015 at 7:08 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> 1. The performance gain from this on real programs is small. I will suggest<br>
> that the total performance gain from optimisations that rely on exploiting<br>
> undefined behaviour - let's call them monkey's paw optimisations for short -<br>
> is practically never more than a few percent, and often less than one<br>
> percent.<br>
><br>
> 2. For most programs, having the program work is worth far more than having<br>
> it run a few percent faster.<br>
<br>
</span>Which may or may not be fine until you decide to switch<br>
compilers/platforms. Encouraging programmers to use Clang-specific<br>
interpretations of these constructs would promote vendor lock-in and<br>
be a blow for portability, which I think is worse than UB. At least<br>
now we can tell people "you're doing it wrong".<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>