This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20681] [4.0/4.1/4.2 Regression] wrong "control reaches" warning with switches
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jul 2006 15:30:12 -0000
- Subject: [Bug c++/20681] [4.0/4.1/4.2 Regression] wrong "control reaches" warning with switches
- References: <bug-20681-9121@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from pluto at agmk dot net 2006-07-03 15:30 -------
(In reply to comment #15)
> one more valid code rejected by 4.1/4.2:
>
> typedef enum { foo, bar } e;
> int zoo( e __e )
> {
> switch ( __e )
> {
> case foo: return -1;
> case bar: return +1;
> }
> }
>
> $ x86_64-gnu-linux-g++ bug.cpp -c -Wall -O2
> bug.cpp: In function 'int zoo(e)':
> bug.cpp:9: warning: control reaches end of non-void function
>
ohh, 3.3.6 also fails.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20681