Thread (11 messages) flat view 11 messages, 3 authors, 2007-09-06

Re: [PATCH -mm 1/2] 3c59x: Fix uninitialized variable bug

From: Steffen Klassert <hidden>
Date: 2007-09-04 09:18:19
Also in: lkml

On Tue, Sep 04, 2007 at 09:53:31AM +0100, Mark Hindley wrote:
On Tue, Sep 04, 2007 at 02:09:47PM +0530, Satyam Sharma wrote:
quoted
Hi Steffen,


On Tue, 4 Sep 2007, Steffen Klassert wrote:
quoted
On Tue, Sep 04, 2007 at 03:45:55AM +0530, Satyam Sharma wrote:
quoted
drivers/net/3c59x.c: In function 'vortex_up':
drivers/net/3c59x.c:1495: warning: 'err' may be used uninitialized in this function
This came in with the recently applied 3c59x-check-return-of-pci_enable_device patch
from Mark Hindley. I just compiled it on a PCI only machine so far, therefore I did
not notice the warning yet.
Hmm, the .config I built with had PCI=y as well. Probably a compiler
version difference -- Jeff also mentioned yesterday that some newer
GCC versions fail to warn about uninitialized variables cases.
Sorry, this is my bad. I have just checked: there is no warning with gcc
4.2 or 4.1, but 3.3 emits the warning. 
The only warning that I was able to trigger with gcc 4.2 is in the case of a .config
without PCI support. In this case I get

drivers/net/3c59x.c: In function 'vortex_up':
drivers/net/3c59x.c:1672: warning: 'err' is used uninitialized in this function
                                         ^^
So we have to be more carefull with the newer gcc versions.

Steffen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help