This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22121] Suspicious "may be used uninitialized" warning.
- 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: 19 Jun 2005 16:41:53 -0000
- Subject: [Bug c++/22121] Suspicious "may be used uninitialized" warning.
- References: <20050619155454.22121.rspencer@x10sys.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-19 16:41 -------
This is invalid, the reduced testcase comes down to the following testcase:
bool error();
bool hh(int i);
int siz();
static inline bool parse(int &V)
{
for(int i = 0 ; i< siz(); i++)
{
if (hh(i))
{
V = i;
return false;
}
}
return error();
}
void setValue(int i);
bool f()
{
int i;
if (parse(i))
return true;
setValue(i);
return false;
}
Note how we don't know what error returns, so we don't know if it returns true or false.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22121