<div dir="ltr">Thank you. I will try to compile clang to see the problem when I have spare time.<div><br></div><div style>Cheers,</div><div style>Jean.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/21 Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">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><div class="h5"><div>On Oct 20, 2013, at 12:57 AM, Jean Lee <<a href="mailto:xiaoyur347@gmail.com" target="_blank">xiaoyur347@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><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></div></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">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><br>
</blockquote></div><br></div></div></blockquote></div><br></div>