<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I am the moderator, but I don’t seem to have received that message.&nbsp; But it seems your message has gone through.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> ub-bounces@open-std.org &lt;ub-bounces@open-std.org&gt;
<b>On Behalf Of </b>Scott Schurr<br>
<b>Sent:</b> Tuesday, January 29, 2019 5:56 PM<br>
<b>To:</b> WG21 UB study group SG12 &lt;ub@open-std.org&gt;<br>
<b>Subject:</b> Re: [ub] P1407R0: Tell Programmers About Signed Integer Overflow Behavior<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">Greetings SG12,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I sent the following email yesterday, but received a response that the email to the group was being held for moderation.&nbsp; After waiting more than 24 hours I've not heard back regarding moderation.&nbsp; I'm unsure how to directly contact the
 moderator.&nbsp; So I'm trying again.&nbsp; I beg your pardon if this leads to duplication.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Scott Schurr<br>
<a href="mailto:S.Scott.Schurr@gmail.com" target="_blank">S.Scott.Schurr@gmail.com</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Jan 28, 2019 at 9:32 AM Scott Schurr &lt;<a href="mailto:s.scott.schurr@gmail.com">s.scott.schurr@gmail.com</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hello Mr. Glisse,<br clear="all">
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Thanks very much for your interest in paper P1407R0.&nbsp; I appreciate your information about gcc's behavior.&nbsp; If an R1 version of the paper is published it will incorporate both of your points with attribution to you.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">As for the appropriate target, I hear your concerns.&nbsp; Certainly the approach proposed in the paper is far from ideal.&nbsp; The problem comes from arriving at consensus regarding what an ideal, or even good enough, approach would be.&nbsp; My personal
 opinion is that the status quo is about as far from ideal as we could get.&nbsp; But I also understand that there are plenty of people who disagree with my view.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks again.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Scott Schurr<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="mailto:S.Scott.Schurr@gmail.com" target="_blank">S.Scott.Schurr@gmail.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">On Sat, Jan 26, 2019 at 12:44 AM Marc Glisse &lt;<a href="mailto:marc.glisse@inria.fr" target="_blank">marc.glisse@inria.fr</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hello,<br>
<br>
just a couple points missing from the paper:<br>
<br>
1) with g&#43;&#43;-7 -O2 -Wall, the motivating example on the left produces:<br>
<br>
&lt;source&gt;: In function 'int32_t add_100_without_wrap(int32_t)':<br>
&lt;source&gt;:8:3: warning: assuming signed overflow does not occur when assuming that (X &#43; c) &lt; X is always false [-Wstrict-overflow]<br>
&nbsp; &nbsp; if (ret &lt; a)<br>
<br>
However, we removed the warning from gcc-8 because it was too noisy and <br>
impossible to work around when the optimization is what you actually want.<br>
<br>
2) At least with gcc, -ftrapv doesn't really work. You need <br>
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error for <br>
something roughly equivalent to what -ftrapv is supposed to do.<br>
<br>
<br>
Now my opinion: you have the wrong target. Compilers that have a -fwrapv <br>
option (or -ftrapv or ubsan or ...) already indirectly describe the <br>
default behavior as undefined (and the standard already describes it as <br>
undefined), so it is already documented. Adding a sentence or 2 in the <br>
standard and on pages that nobody reads won't help. It seems that you want <br>
to talk either to teachers, so they warn their students more about the <br>
properties of signed overflow, or to compiler writers, to convince them to <br>
change the default to -fwrapv or -ftrapv (I hope they don't) or add more <br>
warnings.<br>
<br>
-- <br>
Marc Glisse<o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>