<div dir="ltr">On Mon, Mar 12, 2018 at 4:10 PM, Myria <span dir="ltr"><<a href="mailto:myriachan@gmail.com" target="_blank">myriachan@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">The severity of the current situation is that I generally avoid signed<br>
integers if I intend to do any arithmetic on them whatsoever, lest the<br>
compiler decide to make demons come out of my nose. And even then,<br>
I'm not safe:<br>
<br>
std::uint16_t x = 0xFFFF;<br>
x *= x; // undefined behavior on most modern platforms<br></blockquote><div><br></div><div>Why is wrapping better, especially at the cost of sanitizers no longer detecting this by default? Are you really getting a useful result here?</div><div><br></div><div>This is the problem with unsigned: we cannot tell the difference between accidentally wrapping vs. intentionally wrapping.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
I would be happy if an option like -fwrapv were supported everywhere,<br>
but Visual Studio doesn't have such an option, and Microsoft has<br>
already denied requests for such an option to be implemented.<br></blockquote><div><br></div><div>If this is *intentional*, I'd much rather have it reflected in the type system (or some other mechanism) rather than changing all ints to wrap, even by compiler flags.</div></div>-- <br><div class="m_-8175190369437538398gmail_signature"><div dir="ltr"><div><div dir="ltr"><div> Nevin ":-)" Liber <mailto:<a href="mailto:nevin@eviloverlord.com" target="_blank">nevin@eviloverlord.com</a><wbr>> <a href="tel:(847)%20691-1404" value="+18476911404" target="_blank">+1-847-691-1404</a></div></div></div></div></div>
</div></div>