<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 7, 2008, at 1:38 PM, Nico Weber wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><blockquote type="cite"><blockquote type="cite"><br class="Apple-interchange-newline">2. The project I'm checking contains several sections that look like<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">this:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  const void *bytes = [data bytes];<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  int rows = *((int*)bytes); bytes += sizeof(int);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">scan_build complains in these cases that "Value stored to 'bytes' is<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">never read".<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I mocked up a test case, but I couldn't really reproduce this error.  If it is no trouble, can you file a Bugzilla report with a reduced test case that exhibits the problem?  Filing a Bugzilla report also ensures that a fix eventually goes in, as requests for changes have started queuing up and I don't want to forget this one.<br></blockquote><br>Done:<span class="Apple-converted-space"> </span><a href="http://llvm.org/bugs/show_bug.cgi?id=2528">http://llvm.org/bugs/show_bug.cgi?id=2528</a></span></blockquote></div><br><div>Thanks for filing the bug report.  My belief is that the checker is doing the right thing.  The warning has to do with the "+=" operation to bytes, not the store to rows.  The "+=" increment is essentially:</div><div><br></div><div>   bytes = bytes + sizeof(int);</div><div><br></div><div>The checker is saying that the new value stored to bytes is never used (and in your test case, it isn't).</div><div><br></div><div>Could it be the case that the test case doesn't capture the issues that you are seeing?</div><div><br></div><div>Ted</div></body></html>