lkml.org 
[lkml]   [2009]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: "elf core dump: fix get_user use" breaks mips compilation
    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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2009-02-18 12:23    [W:4.850 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site