This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/22121] Suspicious "may be used uninitialized" warning.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]