public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38337]  New: Wrong "is used uninitialized in this function" warning
@ 2008-12-01  2:37 yakov at emc dot com
  2008-12-01  9:46 ` [Bug c/38337] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yakov at emc dot com @ 2008-12-01  2:37 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/38337] Wrong "is used uninitialized in this function" warning
  2008-12-01  2:37 [Bug c/38337] New: Wrong "is used uninitialized in this function" warning yakov at emc dot com
@ 2008-12-01  9:46 ` rguenth at gcc dot gnu dot org
  2008-12-01 18:17 ` yakov at emc dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-01  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-12-01 09:45 -------
works for me


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Wrong "is used uninitialized|Wrong "is used uninitialized
                   |in this function" warning   |in this function" warning


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/38337] Wrong "is used uninitialized in this function" warning
  2008-12-01  2:37 [Bug c/38337] New: Wrong "is used uninitialized in this function" warning yakov at emc dot com
  2008-12-01  9:46 ` [Bug c/38337] " rguenth at gcc dot gnu dot org
@ 2008-12-01 18:17 ` yakov at emc dot com
  2008-12-24  1:34 ` [Bug middle-end/38337] " pinskia at gcc dot gnu dot org
  2009-02-09 15:41 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: yakov at emc dot com @ 2008-12-01 18:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from yakov at emc dot com  2008-12-01 18:16 -------
Subject: Re:  Wrong "is used uninitialized in this function"
 warning

Richard,
it work for me too if T_SRS_ID would be modified
typedef struct S_SPS_ID
{
   unsigned char dir;
   unsigned char loop;
   unsigned char dae_idx;
   unsigned char lcc;
   unsigned char rack_side;
   unsigned char rack_indx;
   unsigned char in_rack_loc;
   unsigned char pad;
} T_SPS_ID;
like this:
typedef struct S_SPS_ID
{
   unsigned char dir;
   unsigned char loop;
   unsigned char dae_idx;
   unsigned char lcc;
   unsigned char rack_side;
   unsigned char rack_indx;
   unsigned long pad;
} T_SPS_ID;
Also it would works with this modification:
typedef struct S_SPS_ID
{
   unsigned short dir;
   unsigned short lcc;
   unsigned short rack_side;
   unsigned short pad;
} T_SPS_ID;


thanks,
yakov


rguenth at gcc dot gnu dot org wrote:
> ------- Comment #1 from rguenth at gcc dot gnu dot org  2008-12-01 09:45 -------
> works for me
>
>
>   


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/38337] Wrong "is used uninitialized in this function" warning
  2008-12-01  2:37 [Bug c/38337] New: Wrong "is used uninitialized in this function" warning yakov at emc dot com
  2008-12-01  9:46 ` [Bug c/38337] " rguenth at gcc dot gnu dot org
  2008-12-01 18:17 ` yakov at emc dot com
@ 2008-12-24  1:34 ` pinskia at gcc dot gnu dot org
  2009-02-09 15:41 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-24  1:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-12-24 01:31 -------
THis works for me also on the trunk.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |middle-end


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/38337] Wrong "is used uninitialized in this function" warning
  2008-12-01  2:37 [Bug c/38337] New: Wrong "is used uninitialized in this function" warning yakov at emc dot com
                   ` (2 preceding siblings ...)
  2008-12-24  1:34 ` [Bug middle-end/38337] " pinskia at gcc dot gnu dot org
@ 2009-02-09 15:41 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-02-09 15:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from manu at gcc dot gnu dot org  2009-02-09 15:41 -------
We cannot reproduce the bug you reported with a recent revision of GCC 4.4.

If you still see the problem, please reopen. Thanks.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
             Status|WAITING                     |RESOLVED
         Resolution|                            |WORKSFORME


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-09 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-01  2:37 [Bug c/38337] New: Wrong "is used uninitialized in this function" warning yakov at emc dot com
2008-12-01  9:46 ` [Bug c/38337] " rguenth at gcc dot gnu dot org
2008-12-01 18:17 ` yakov at emc dot com
2008-12-24  1:34 ` [Bug middle-end/38337] " pinskia at gcc dot gnu dot org
2009-02-09 15:41 ` manu at gcc dot gnu dot org

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).