mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dave Jones <davej@redhat.com>, Keith Owens <kaos@ocs.com.au>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.14 assorted warnings
Date: Mon, 31 Oct 2005 11:53:27 +1100	[thread overview]
Message-ID: <17253.27399.700034.125453@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <1130710531.32734.5.camel@localhost.localdomain>

Alan Cox writes:

> gcc is a *LOT* smarter than you give it credit for. It will not warn for
> cases where it isn't able to tell how foo is used passed with &foo. It
> will warn for cases where it can

Gcc thinks it is a lot smarter than it actually is, in fact. :)

The usual case where it gives a bogus warning is where the value of
one variable is correlated with the defined-ness of another, for
example:

	found = 0;
	for (i = 0; i < N; ++i) {
		if (a[i] == foo) {
			x = b[i];
			found = 1;
			break;
		}
	}
	if (found)
		bar(x);

Gcc will warn on the use of x when in fact it is perfectly OK, and we
get quite a few of these in compiling a kernel.  At a minimum, I would
like to be able to disable the "may be used uninitialized" warnings
while still getting the "is used uninitialized" warnings.

Paul.

  parent reply	other threads:[~2005-10-31  0:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-28  7:21 Keith Owens
2005-10-28  7:28 ` Jens Axboe
2005-10-28  7:30 ` Dave Jones
2005-10-28  8:07   ` Arnd Bergmann
2005-10-28  8:29     ` Jens Axboe
2005-10-29  5:59       ` Richard Knutsson
2005-10-29  6:03         ` Al Viro
2005-10-28  8:10   ` Richard Knutsson
2005-10-30 22:15   ` Alan Cox
2005-10-30 22:25     ` Al Viro
2005-10-30 22:32       ` Al Viro
2005-10-30 22:29         ` Stephen Rothwell
2005-10-31  0:53     ` Paul Mackerras [this message]
2005-10-31  0:57       ` Al Viro

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=17253.27399.700034.125453@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®