This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Sep 2005 20:35:06 -0000
- Subject: [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function
- References: <20050929202345.24129.doko@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-29 20:35 -------
Lets look at the two functions:
static int
r_short(RFILE *p)
{
register short x;
x = ((p)->fp ? _IO_getc ((p)->fp) : (((p)->ptr != (p)->end) ? (unsigned char)*(p)->ptr++ : (-1)));
x |= ((p)->fp ? _IO_getc ((p)->fp) : (((p)->ptr != (p)->end) ? (unsigned char)*(p)->ptr++ : (-1))) << 8;
x |= -(x & 0x8000);
return x;
}
int
PyMarshal_ReadShortFromFile(FILE *fp)
{
WFILE rf;
rf.fp = fp;
rf.strings = ((void *)0);
return r_short(&rf);
}
It is obvious that the warnings are valid as rf.end and rf.ptr is not initialized in
PyMarshal_ReadShortFromFile. There are no way to know that the arguments passing to
PyMarshal_ReadShortFromFile are non null from the source you gave so the warning is correct.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129