All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] gcc4 warnings, variable used uninitialized
Date: Tue, 21 Feb 2006 20:20:03 +0000	[thread overview]
Message-ID: <20060221202003.GA24159@redhat.com> (raw)
In-Reply-To: <1140524267.2600.9.camel@omega.sp.or.at>

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

On Tue, Feb 21, 2006 at 09:12:28PM +0100, Stephan Peijnik wrote:

 > I'm compiling a fresh copy of 4.1 right now, but a good example would be
 > drivers/char/agp/generic.c's get_agp_version function. It defines a 'u32
 > ncapid'. A pointer to that u32 is then given to pci_read_config_dword
 > and at exactly that point gcc-4.0 starts complaining. See below.
 > 
 > <snip>
 > void get_agp_version(struct agp_bridge_data *bridge)
 > {
 > 	u32 ncapid;
 > 
 > 	/* Exit early if already set by errata workarounds. */
 > 	if (bridge->major_version != 0)
 > 		return;
 > 
 > 	pci_read_config_dword(bridge->dev, bridge->capndx, &ncapid);
 > [...]
 > </snip>

gcc bug.  It doesn't seem to understand that sometimes ptrs to vars get
passed to functions that instantiate them.

There are dozens and dozens of such instances in the kernel tree.
99% of the time that warning is completely bogus.

		Dave


[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2006-02-21 20:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 12:17 [KJ] gcc4 warnings, variable used uninitialized Stephan Peijnik
2006-02-21 12:42 ` Arnd Bergmann
2006-02-21 20:12 ` Stephan Peijnik
2006-02-21 20:20 ` Dave Jones [this message]
2006-02-21 23:51 ` Håkon Løvdal
2006-02-22  0:19 ` Bernd Petrovitsch
2006-02-22  3:51 ` Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060221202003.GA24159@redhat.com \
    --to=davej@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.