* Re: [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali
2012-09-06 15:00 [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali Berg, Johannes
@ 2012-09-07 1:41 ` Fengguang Wu
2012-09-07 7:40 ` Berg, Johannes
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Fengguang Wu @ 2012-09-07 1:41 UTC (permalink / raw)
To: kernel-janitors
On Thu, Sep 06, 2012 at 11:00:01PM +0800, Berg, Johannes wrote:
> Hi,
>
> Thanks.
>
> > net/mac80211/mlme.c: In function 'ieee80211_rx_mgmt_beacon':
> > net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitialized
> > in this function [-Wmaybe-uninitialized]
> > net/mac80211/mlme.c:871:6: note: 'chan_pwr' was declared here
>
> I think this is a false positive? It's only used if have_chan_pwr is true, and that's set only if chan_pwr is set.
Yes..many of the compiler warnings are false ones. They are sent out
anyway because I believe it's good practice to just quiet *all* gcc
warnings.
Would you apply the followed fix?
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali
2012-09-06 15:00 [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali Berg, Johannes
2012-09-07 1:41 ` Fengguang Wu
@ 2012-09-07 7:40 ` Berg, Johannes
2012-09-07 7:49 ` Fengguang Wu
2012-09-07 7:51 ` Berg, Johannes
3 siblings, 0 replies; 5+ messages in thread
From: Berg, Johannes @ 2012-09-07 7:40 UTC (permalink / raw)
To: kernel-janitors
> > > net/mac80211/mlme.c: In function 'ieee80211_rx_mgmt_beacon':
> > > net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used
> > > uninitialized in this function [-Wmaybe-uninitialized]
> > > net/mac80211/mlme.c:871:6: note: 'chan_pwr' was declared here
> >
> > I think this is a false positive? It's only used if have_chan_pwr is true, and
> that's set only if chan_pwr is set.
>
> Yes..many of the compiler warnings are false ones. They are sent out anyway
> because I believe it's good practice to just quiet *all* gcc warnings.
>
> Would you apply the followed fix?
No. I don't believe that we should arbitrarily shut up gcc warnings by doing things like this as it may very well shut up legitimate warnings in the future. Also, newer gccs (like my 4.7.1) don't warn here.
johannes
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Peter Gleissner, Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali
2012-09-06 15:00 [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali Berg, Johannes
2012-09-07 1:41 ` Fengguang Wu
2012-09-07 7:40 ` Berg, Johannes
@ 2012-09-07 7:49 ` Fengguang Wu
2012-09-07 7:51 ` Berg, Johannes
3 siblings, 0 replies; 5+ messages in thread
From: Fengguang Wu @ 2012-09-07 7:49 UTC (permalink / raw)
To: kernel-janitors
On Fri, Sep 07, 2012 at 03:40:41PM +0800, Berg, Johannes wrote:
> > > > net/mac80211/mlme.c: In function 'ieee80211_rx_mgmt_beacon':
> > > > net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used
> > > > uninitialized in this function [-Wmaybe-uninitialized]
> > > > net/mac80211/mlme.c:871:6: note: 'chan_pwr' was declared here
> > >
> > > I think this is a false positive? It's only used if have_chan_pwr is true, and
> > that's set only if chan_pwr is set.
> >
> > Yes..many of the compiler warnings are false ones. They are sent out anyway
> > because I believe it's good practice to just quiet *all* gcc warnings.
> >
> > Would you apply the followed fix?
>
> No. I don't believe that we should arbitrarily shut up gcc warnings
> by doing things like this as it may very well shut up legitimate
> warnings in the future.
Yes, it's now all good and there are ups and downs..
> Also, newer gccs (like my 4.7.1) don't warn
> here.
I'm also running gcc 4.7.1 and it's behavior is a bit interesting:
make allmodconfig is fine while this particular config will trigger
the false warning ;)
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali
2012-09-06 15:00 [mac80211-next:wip 56/57] net/mac80211/mlme.c:903:43: warning: 'chan_pwr' may be used uninitiali Berg, Johannes
` (2 preceding siblings ...)
2012-09-07 7:49 ` Fengguang Wu
@ 2012-09-07 7:51 ` Berg, Johannes
3 siblings, 0 replies; 5+ messages in thread
From: Berg, Johannes @ 2012-09-07 7:51 UTC (permalink / raw)
To: kernel-janitors
> > Also, newer gccs (like my 4.7.1) don't warn here.
>
> I'm also running gcc 4.7.1 and it's behavior is a bit interesting:
> make allmodconfig is fine while this particular config will trigger the false
> warning ;)
Heh, that's interesting! I wonder what that is? I'm mostly building modules only out-of-tree... Odd!
johannes
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Peter Gleissner, Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply [flat|nested] 5+ messages in thread