[cfe-dev] Static analyzer

Ted Kremenek kremenek at apple.com
Mon Jul 7 13:05:41 PDT 2008


On Jul 7, 2008, at 9:45 AM, Nico Weber wrote:

> Hi,
>
> I'm currently playing with the static analyzer. It looks very nice, it
> found a few leaks already. Two comments:
>
> 1. It would be very useful to me if the file name of the reports could
> include the (beginning of) the original file name. When I'm looking at
> the reports in Safari, I could then simply look at the URL bar to see
> which file the current report is for.

Hi Nico,

Today I committed a patch that puts the name of the file with the bug  
in the title of the report page:

   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080707/006407.html

This patch should now be available in checker-58 (for those using the  
prebuilt binaries for Mac OS X).

We can also potentially include a fragment of the original source file  
name in the name of the report-XXX.html file as well.  I'm not certain  
if that is necessary given the patch I mentioned.  What do you think?   
I'm fine with making the change if you feel it would make the tool  
easier to use.

> 2. The project I'm checking contains several sections that look like
> this:
>
>     const void *bytes = [data bytes];
>     int rows = *((int*)bytes); bytes += sizeof(int);
>
> scan_build complains in these cases that "Value stored to 'bytes' is
> never read".

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.

Thanks for the feedback!

Ted



More information about the cfe-dev mailing list