[Bug c++/20681] [4.3/4.4/4.5/4.6 Regression] wrong "control reaches" warning with switches
ami at fischman dot org
gcc-bugzilla@gcc.gnu.org
Thu Feb 24 00:59:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20681
--- Comment #29 from Ami Fischman <ami at fischman dot org> 2011-02-23 23:35:45 UTC ---
Further reduced test case from dup bug 47864:
$ nl t.cc ; g++ -finstrument-functions -Wreturn-type -Werror -c t.cc
1 int foo(int type) {
2 switch(type) {
3 case 0: return 1; break;
4 default: return 0;
5 }
6 }
cc1plus: warnings being treated as errors
t.cc: In function ‘int foo(int)’:
t.cc:6: error: control reaches end of non-void function
(in 4.4.3)
More information about the Gcc-bugs
mailing list