2014-01-02 21:56:58

by David Rientjes

[permalink] [raw]
Subject: Re: Question on compiler warning

On Mon, 30 Dec 2013, Larry Finger wrote:

> + /scratch/kisskb/src/drivers/net/wireless/b43/phy_n.c: warning: 'val_addr'
> may be used uninitialized in this function [-Wuninitialized]: => 178:21
>
> This warning does not show up on any of my compilers, and it should not as the
> initialization and usage of that variable both take place in conditional
> branches that are testing exactly the same pointer.
>

You may not be compiling this file depending on your .config or you may
have a different setting for CONFIG_CC_OPTIMIZE_FOR_SIZE.


2014-01-02 22:14:38

by Larry Finger

[permalink] [raw]
Subject: Re: Question on compiler warning

On 01/02/2014 03:56 PM, David Rientjes wrote:
> On Mon, 30 Dec 2013, Larry Finger wrote:
>
>> + /scratch/kisskb/src/drivers/net/wireless/b43/phy_n.c: warning: 'val_addr'
>> may be used uninitialized in this function [-Wuninitialized]: => 178:21
>>
>> This warning does not show up on any of my compilers, and it should not as the
>> initialization and usage of that variable both take place in conditional
>> branches that are testing exactly the same pointer.
>>
>
> You may not be compiling this file depending on your .config or you may
> have a different setting for CONFIG_CC_OPTIMIZE_FOR_SIZE.

I am definitely building this driver in my configuration. Variable
CONFIG_CC_OPTIMIZE_FOR_SIZE was not set, but changing it to "y" did not change
the result.

Thanks,

Larry

2014-01-02 23:40:41

by David Rientjes

[permalink] [raw]
Subject: Re: Question on compiler warning

On Thu, 2 Jan 2014, Larry Finger wrote:

> I am definitely building this driver in my configuration. Variable
> CONFIG_CC_OPTIMIZE_FOR_SIZE was not set, but changing it to "y" did not change
> the result.
>

I get this warning with gcc-4.6.3 and my gcc-4.5.1 cross compiler.