False positives for unused variable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

False positives for unused variable

Steven Osborn
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

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

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.

--
Steven Osborn
http://steven.bitsetters.com
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: False positives for unused variable

Ted Kremenek

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.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev