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