<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I cannot reproduce this on latest clang (TOT) with or without the alpha checkers.<div><br></div><div>Also, most of the alpha checkers will have false positives and bugs.</div><div><br></div><div>Cheers,</div><div>Anna.</div><div><br><div><div>On Oct 20, 2013, at 12:57 AM, Jean Lee <<a href="mailto:xiaoyur347@gmail.com">xiaoyur347@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">My environment:<div>LLVM 3.3 + CLANG 3.3<br><div><br></div><div><br></div><div>Build command:</div><div><div>CHECKER="-enable-checker alpha.unix.Stream -enable-checker alpha.unix.SimpleStream -enable-checker alpha.core.SizeofPtr -enable-checker alpha.unix.cstring.BufferOverlap -enable-checker alpha.security.ArrayBoundV2 -enable-checker alpha.unix.PthreadLock"</div>
<div><br></div><div>scan-build-3.3 ${CHECKER} g++ static_analyzer.cpp -pthread</div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/20 Jean Lee <span dir="ltr"><<a href="mailto:xiaoyur347@gmail.com" target="_blank">xiaoyur347@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>#include <stdio.h></div><div>void FunctionFread(const char* szFile)</div><div>{</div><div><span style="white-space:pre-wrap"> </span>FILE *fp = fopen(szFile, "rb");</div>
<div><span style="white-space:pre-wrap"> </span>if (fp == NULL)</div>
<div><span style="white-space:pre-wrap"> </span>{</div><div><span style="white-space:pre-wrap"> </span>return;</div><div><span style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>int ofs[2], len;</div><div><span style="white-space:pre-wrap"> </span>int nReadNum = fread( ofs, sizeof(int), 2, fp );</div><div><br></div><div><span style="white-space:pre-wrap"> </span>if ( nReadNum != 2 )</div>
<div><span style="white-space:pre-wrap"> </span>{</div><div><span style="white-space:pre-wrap"> </span>fclose(fp);</div><div><span style="white-space:pre-wrap"> </span>return;</div><div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> // warning: The left operand of '-' is a garbage value</span></div><div><span style="white-space:pre-wrap"> </span>len = ofs[1] - ofs[0];</div>
<div><span style="white-space:pre-wrap"> </span>printf("length=%d\n", len);</div><div><span style="white-space:pre-wrap"> </span>fclose(fp);</div><div>}</div></div>
</blockquote></div><br></div>
_______________________________________________<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">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div></body></html>