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++/20681] [4.3/4.4/4.5/4.6 Regression] wrong "control reaches" warning with switches


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)


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