[cfe-dev] False positives for unused variable

Ted Kremenek kremenek at apple.com
Thu Feb 25 21:01:57 PST 2010


On Feb 25, 2010, at 8:01 PM, Steven Osborn wrote:

> I'm getting a slew of errors like this in the minizip libs.
> 
> 1055:17 Value stored to 'err' is never read
> 
> http://bitbucket.org/urbanairship/storefront/src/5cd9eba47943/Airship/External/ZipFile-OC/minizip/zip.c#cl-1055
> 
> but the value is read on like 1064

Hi Steven,

The analyzer is correct.  The value is overwritten on line 1060, prior to the read on line 1064.  The warning is not that 'err' is never read, but that the value you stored to it is never read.

> 
> http://bitbucket.org/urbanairship/storefront/src/5cd9eba47943/Airship/External/ZipFile-OC/minizip/zip.c#cl-1064
> 
> and in the while loop itself on line 1049

Same reason as above.  The value gets overwritten on line 1060.

> 
> http://bitbucket.org/urbanairship/storefront/src/5cd9eba47943/Airship/External/ZipFile-OC/minizip/zip.c#cl-1049
> 
> 
> Let me know if I should file a bug report and if there is any way I
> can work around the errors for now.

This doesn't look like a false positive.



More information about the cfe-dev mailing list