<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=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","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;}
span.StylE-mailovZprvy17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.hps
{mso-style-name:hps;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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=CS link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span class=hps><span lang=EN>I looked into the</span></span><span lang=EN> <span class=hps>code</span> <span class=hps>and I think</span> <span class=hps>it's</span> <span class=hps>a missing</span> <span class=hps>feature.</span> <span class=hps>The question is whether</span> <span class=hps>it is worth</span> <span class=hps>implementing</span>.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> David Blaikie [mailto:dblaikie@gmail.com] <br><b>Sent:</b> Monday, January 20, 2014 7:37 PM<br><b>To:</b> miroslav.fontan; Richard Smith<br><b>Cc:</b> cfe-dev Developers<br><b>Subject:</b> Re: [cfe-dev] A need for an "-fsanitize=integer-assign-overflow"<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>In theory something like UBSan (-fsanitize=undefined) or the Integer sanitizer (-fsanitize=integer) should help catch this at runtime, but I can't seem to get them to fire on this code. Not sure if it's a missing feature/bug or some necessary false negative.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Mon, Jan 20, 2014 at 6:28 AM, miroslav.fontan <<a href="mailto:miroslav.fontan@wincor-nixdorf.cz" target="_blank">miroslav.fontan@wincor-nixdorf.cz</a>> wrote:<o:p></o:p></p><p class=MsoNormal>Hi all,<br><br>I would like to ask whether it is possible to turn an integer sanitizer to<br>capture integer overflows in an assignment statement<br><br>int32_t i32 = INT32_MAX;<br>int16_t i16 = i32; // runtime warning "integer assignment overflow" would be<br>fine<br><br>I know there is a flag -Wconversion and the code should compile cleanly with<br>-Wconversion -Werror. At this point it is impossible to clean the entire<br>code base, I need to first find the most critical parts and to start<br>cleaning the code from there<br><br>Regards<br>---<br>Mira<br><br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>