gcc4x/vtrunk-2.19-2008-11-29_ntv/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/yakov/svn-gnu-gcc/gcc-trunk/configure
--enable-languages=c,c++ --disable-nls --disable-c-mbchar --disable-shared
--with-gmp=/emc/ucode/Linux-2x-i686/gmp-4.2.2
--with-mpfr=/emc/ucode/Linux-2x-i686/mpfr-2.3.1
--prefix=/emc/ucode/Linux-2x-i686/gcc4x/vtrunk-2.19-2008-11-29_ntv
Thread model: posix
gcc version 4.4.0 20081128 (experimental) (GCC) 


gcc4x/vtrunk-2.19-2008-11-29_ntv/bin/gcc -Wall -Wno-unknown-pragmas -Wundef
-Winline -Wno-array-bounds -O2 -mtune=core2 -march=core2
-mpreferred-stack-boundary=4 -pedantic -W -Wmissing-declarations
-Wmissing-prototypes -Wno-long-long -Wsequence-point -Wstrict-prototypes
-Wredundant-decls -Wshadow -gstabs -g3 -c bug.c
bug.c: In function 'disp_src_id':
bug.c:28: warning: 'src_id' is used uninitialized in this function
=======================================
typedef struct S_SRS_ID
{
   unsigned char dir;
   unsigned char lp;
   unsigned char idx;
   unsigned char lcx;
   unsigned char side;
   unsigned char indx;
   unsigned char in_loc;
   unsigned char pad;
} T_SRS_ID;

typedef struct S_SRC_REC
{
  unsigned long stamp;
  unsigned long generation;
} T_SRC_REC;

unsigned long fget_src_id(T_SRC_REC *p_lmpi,
                          T_SRS_ID  *p_src_id);

int disp_src_id(T_SRC_REC *p_lmpi,
                T_SRS_ID  *p_params);

int disp_src_id(T_SRC_REC *p_lmpi,
                T_SRS_ID  *p_params)
{
   T_SRS_ID src_id = *(T_SRS_ID *)&p_params[5];
   unsigned long res = fget_src_id(p_lmpi, &src_id);

   if ( res != 0 )
     return(1);
   else
     return(0);
}


-- 
           Summary: Wrong "is used uninitialized in this function" warning
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yakov at emc dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38337

Reply via email to