public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yakov Yazlovitsky <yakov@emc.com>
To: gcc-help@gcc.gnu.org
Subject: Re: invalid line number of "may be used uninitialized" [gcc-4.4.0  trunk;  svn rev:143809]
Date: Fri, 06 Feb 2009 17:14:00 -0000	[thread overview]
Message-ID: <498C6FFE.90609@emc.com> (raw)
In-Reply-To: <498C6F57.3010805@emc.com>

Sorry, forgot the test body:

enum
{
  ENUM_ELEM_NO_PRESENT = 1,
  ENUM_ELEM_STAT_PARAM_ERR = 5,
  ENUM_ELEM_STAT_REBUILD_ERR = 8,
};

extern unsigned foo (unsigned size1, unsigned size2);

unsigned get_global_info (unsigned slot_info)
{
  unsigned size1, size2, alt_size1, alt_size2;
 
  if (slot_info == ENUM_ELEM_NO_PRESENT)
    {
      alt_size1 = ENUM_ELEM_STAT_REBUILD_ERR;
      alt_size2 = ENUM_ELEM_STAT_PARAM_ERR;
      return foo(alt_size1, alt_size2);
    }
  else
    {
      size1 = alt_size1;
      size2 = alt_size2;
      return foo(size1, size2);
    }
}

Yakov Yazlovitsky wrote:
> gcc4x/v4.4.0-trunk-143809-2.19-2009-01-31_ntv/bin/gcc -O2 -W -Wall -v 
> -c uninit-1.c
> uninit-1.c: In function 'get_global_info':
> uninit-1.c:24: warning: 'alt_size1' may be used uninitialized in this 
> function
> uninit-1.c:24: warning: 'alt_size2' may be used uninitialized in this 
> function
>
> svn-gnu-gcc/gcc-4.4.0-trunk-143809/configure --enable-languages=c,c++ 
> --disable-nls --disable-c-mbchar --disable-shared --with-gmp=gmp-4.2.2 \
>                                             --with-mpfr=mpfr-2.4.0 
> --prefix=gcc4x/v4.4.0-trunk-143809-2.19-2009-01-31_ntv
> GNU C (GCC) version 4.4.0 20090130 (experimental) (i686-pc-linux-gnu)
>    compiled by GNU C version 4.4.0 20090130 (experimental), GMP 
> version 4.2.2, MPFR version 2.4.0.
> GNU assembler version 2.19 (i686-pc-linux-gnu) using BFD version (GNU 
> Binutils) 2.19
> ------------------------------------------------------------------------------------------------- 
>
> gcc4x/v4.3.3-143643-2.19-2009-02-02_ntv/bin/gcc -O2 -W -Wall -v -c 
> uninit-1.c
> uninit-1.c: In function 'get_global_info':
> uninit-1.c:22: warning: 'alt_size1' may be used uninitialized in this 
> function
> uninit-1.c:23: warning: 'alt_size2' may be used uninitialized in this 
> function
> svn-gnu-gcc/gcc-4.3.3-143643/configure --enable-languages=c,c++ 
> --disable-nls --disable-c-mbchar --disable-shared --with-gmp=gmp-4.2.2 \
>                                       --with-mpfr=mpfr-2.4.0 
> --prefix=gcc4x/v4.3.3-143643-2.19-2009-02-02_ntv
> GNU C (GCC) version 4.3.3 (i686-pc-linux-gnu)
>    compiled by GNU C version 4.3.3, GMP version 4.2.2, MPFR version 
> 2.4.0.
> GNU assembler version 2.19 (i686-pc-linux-gnu) using BFD version (GNU 
> Binutils) 2.19
> ============================================================================================================= 
>
> gcc4x/v4.3_branch-143771-2.19-2009-02-01_ntv/bin/gcc -O2 -W -Wall -v 
> -c uninit-1.c
> uninit-1.c: In function 'get_global_info':
> uninit-1.c:22: warning: 'alt_size1' may be used uninitialized in this 
> function
> uninit-1.c:23: warning: 'alt_size2' may be used uninitialized in this 
> function
>
> svn-gnu-gcc/gcc-4.3_branch-143771/configure --enable-languages=c,c++ 
> --disable-nls --disable-c-mbchar --disable-shared --with-gmp=gmp-4.2.2 \
>                                            --with-mpfr=mpfr-2.4.0 
> --prefix=gcc4x/v4.3_branch-143771-2.19-2009-02-01_ntv
> GNU C (GCC) version 4.3.4 20090129 (prerelease) (i686-pc-linux-gnu)
>    compiled by GNU C version 4.3.4 20090129 (prerelease), GMP version 
> 4.2.2, MPFR version 2.4.0.
> GNU assembler version 2.19 (i686-pc-linux-gnu) using BFD version (GNU 
> Binutils) 2.19
> =============================================================================================================== 
>
> openSUSE 10.2 (i586)
>
> Linux domain-name 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 
> 2006 i686 i686 i386 GNU/Linux
>
>
>

      reply	other threads:[~2009-02-06 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 12:30 Kind of regression? Yakov Yazlovitsky
2009-02-06 17:12 ` invalid line number of "may be used uninitialized" [gcc-4.4.0 trunk; svn rev:143809] Yakov Yazlovitsky
2009-02-06 17:14   ` Yakov Yazlovitsky [this message]

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=498C6FFE.90609@emc.com \
    --to=yakov@emc.com \
    --cc=gcc-help@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).