[PATCH 1/1] Staging: android: binder: Fix possible uninitialized variable compile warning
Javier Martinez Canillas
javier at dowhile0.org
Wed Apr 18 17:41:51 PDT 2012
On Thu, Apr 19, 2012 at 1:53 AM, Greg Kroah-Hartman
<gregkh at linuxfoundation.org> 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 at munra linux]$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
and this is the compiler output:
[javier at munra linux]$ make M=drivers/staging/android
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]
More information about the devel