This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28236] wrong "control reaches" warning with enums.
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2006 14:35:35 -0000
- Subject: [Bug c++/28236] wrong "control reaches" warning with enums.
- References: <bug-28236-7667@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pluto at agmk dot net 2006-07-31 14:35 -------
one more testcase that renders different warning.
typedef enum { X, Y } e;
e zoo( e __e )
{
e r;
switch ( __e )
{
case X: r = Y; break;
case Y: r = X; break;
}
return r;
}
bug.cpp: In function 'e zoo(e)':
bug.cpp:4: warning: 'r' may be used uninitialized in this function
e zoo(e) (__e)
{
e r;
e D.2076;
int __e.0;
<bb 0>:
switch ((int) __e)
{
case 0: goto <L0>;
case 1: goto <L6>;
default : goto <L5>;
}
<L6>:;
r = 0;
goto <bb 3> (<L2>);
<L5>:;
goto <bb 3> (<L2>);
<L0>:;
r = 1;
<L2>:;
return r;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28236