Re: [PATCH 1/1] Staging: android: binder: Fix possible uninitialized variable compile warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 19, 2012 at 1:53 AM, Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Apr 19, 2012 at 01:17:11AM +0200, Javier Martinez Canillas wrote:
>> GCC warns that buffer_size and buffer variables may be used uninitialized.
>> Set default values to make the compiler happy and get rid of the build noise.
>
> No, gcc is broken here then.  Please fix it instead, as we don't want to
> paper over foolish things like that.
>
> What version of gcc causes this? I don't see this with gcc 4.6.2,
> perhaps you are using too old of a gcc?
>
> greg k-h

Actually I see it with a newer GCC, my version is:

[javier@munra linux]$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

and this is the compiler output:

[javier@munra linux]$ make M=drivers/staging/android
  CC      drivers/staging/android/binder.o
drivers/staging/android/binder.c: In function ‘binder_alloc_buf’:
drivers/staging/android/binder.c:779:37: warning: ‘buffer_size’ may be
used uninitialized in this function [-Wuninitialized]
drivers/staging/android/binder.c:779:24: warning: ‘buffer’ may be used
uninitialized in this function [-Wuninitialized]
  LD      drivers/staging/android/built-in.o

Best regards,
Javier
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux