All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Martin Michlmayr <tbm@cyrius.com>
Cc: Roland McGrath <roland@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: "elf core dump: fix get_user use" breaks mips compilation
Date: Mon, 16 Feb 2009 23:32:16 +0000	[thread overview]
Message-ID: <20090216233216.GA19484@linux-mips.org> (raw)
In-Reply-To: <20090216120136.GA9057@deprecation.cyrius.com>

On Mon, Feb 16, 2009 at 01:01:36PM +0100, Martin Michlmayr wrote:

> Hi Roland,
> 
> Your change "elf core dump: fix get_user use"  (which made it into
> 2.6.28.5) breaks the compilation on MIPS (which sets -Werror):
> 
>   CC      arch/mips/kernel/binfmt_elfn32.o
> cc1: warnings being treated as errors
> arch/mips/kernel/../../../fs/binfmt_elf.c: In function ‘vma_dump_size’:
> arch/mips/kernel/../../../fs/binfmt_elf.c:1202: warning: ‘word’ may be used uninitialized in this function
> make[1]: *** [arch/mips/kernel/binfmt_elfn32.o] Error 1

Partially expanding get_user() the code basically does this:

	int word;

	if (access_ok(...))
		__get_user(word, header);
	else
		word = 0;

And gcc is unable to figure out that word will always be assigned to by
both paths of the if statement.  Older gcc versions used to have that
problem.  I can't reproduce your problem with gcc 4.3.2 and I assume
you're using something older than that?

  Ralf

  parent reply	other threads:[~2009-02-16 23:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16 12:01 "elf core dump: fix get_user use" breaks mips compilation Martin Michlmayr
2009-02-16 21:25 ` Roland McGrath
2009-02-17  8:15   ` Martin Michlmayr
2009-02-16 23:32 ` Ralf Baechle [this message]
2009-02-17  7:42   ` Martin Michlmayr
2009-02-17  8:15   ` Christian Borntraeger

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=20090216233216.GA19484@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=tbm@cyrius.com \
    /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.