On Tue, 5 Feb 2008 10:36:16 -0500 (EST) Alan Stern <[EMAIL PROTECTED]> wrote:

> On Mon, 4 Feb 2008 [EMAIL PROTECTED] wrote:
> 
> > From: Andrew Morton <[EMAIL PROTECTED]>
> > 
> > drivers/usb/storage/sddr55.c: In function 'sddr55_transport':
> > drivers/usb/storage/sddr55.c:526: warning: 'deviceID' may be used 
> > uninitialized in this function
> > drivers/usb/storage/sddr55.c:525: warning: 'manufacturerID' may be used 
> > uninitialized in this function
> 
> Unless your version of this routine is significantly different from 
> mine, those warnings are totally bogus.
> 
> >  drivers/usb/storage/sddr55.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff -puN 
> > drivers/usb/storage/sddr55.c~drivers-usb-storage-sddr55c-fix-uninitialized-var-warnings
> >  drivers/usb/storage/sddr55.c
> > --- 
> > a/drivers/usb/storage/sddr55.c~drivers-usb-storage-sddr55c-fix-uninitialized-var-warnings
> > +++ a/drivers/usb/storage/sddr55.c
> > @@ -522,8 +522,8 @@ int sddr55_reset(struct us_data *us) {
> >  
> >  static unsigned long sddr55_get_capacity(struct us_data *us) {
> >  
> > -   unsigned char manufacturerID;
> > -   unsigned char deviceID;
> > +   unsigned char uninitialized_var(manufacturerID);
> > +   unsigned char uninitialized_var(deviceID);
> >     int result;
> >     struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
> 
> Following this I have:
> 
>       US_DEBUGP("Reading capacity...\n");
> 
>       result = sddr55_read_deviceID(us,
>               &manufacturerID,
>               &deviceID);
> 
> The variables are set by sddr55_read_deviceID().  So what's up?  
> Compiler bug?

Yes, some versions of the compiler assume that foo(&bar) might not
initialise bar.

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to