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





On Tue, 4 Sep 2007, Mark Hindley wrote:

On Tue, Sep 04, 2007 at 02:09:47PM +0530, Satyam Sharma wrote:
Hi Steffen,


On Tue, 4 Sep 2007, Steffen Klassert wrote:

On Tue, Sep 04, 2007 at 03:45:55AM +0530, Satyam Sharma wrote:

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.

This is a GCC bug (regression, actually, as you've found out) -- no two
ways about it. Although different from the kind Jeff mentioned couple days
back -- that was about wising GCC up to false positives and /not/ emitting
warnings. But here a genuine problem was not complained about, so this is
more serious. Do you plan to open up a bug at gcc.gnu.org/bugzilla/ ?


Satyam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • New C compiler and analyzer lang/cparser in ports
    ... A few days ago libFIRMand cparser were added to the ports tree. ... If you want to see, what other compilers besides GCC have to offer, this might be of interest for you. ... cparser is a C compiler providing many useful warnings and uses libFIRM for optimization and code generation. ... format.c:5: warning: argument type 'int' does not match conversion specifier '%u' at position 1 ...
    (freebsd-hackers)
  • Re: Compiler Warnings
    ... > I'm new to c and gcc. ... > or book that has a list of the warning messages and their meanings. ... The content and meanings of compiler warning messages ...
    (comp.lang.c)
  • RE: k3b-mp3 for x86_64?
    ... configure:2310: checking for gcc ... configure:2619: checking for C compiler default output file name ... conftest.c:20: warning: "struct stat" declared inside parameter list ... declaration, which is probably not what you want ...
    (Fedora)
  • Re: Compiling chbg: cant find gdk/gdk.h
    ... problem is that the compiler cant find the include file gdk.h. ... checking for gcc... ... checking for Imlib2 configuration using imlib2-config script ... ... absimg.h:70: warning: data definition has no type or storage class ...
    (alt.os.linux)
  • Re: Whats the story with the "end of XP"?
    ... Support gives them access to the larger body ... The same compiler suite may be "best" in both ... In the case of ByteCraft compilers, you are truly expert in your field, you work closely and rapidly with customers if there are any issues, and you have top class testing and quality control. ... understanding the inner workings of a relatively simple compiler like GCC ...
    (comp.arch.embedded)