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++/31783] New: [4.1.2, 4.1.1] bogus "control reaches end of non-void function" warning


gcc 4.1.2 and gcc 4.1.1 shows the following bogus warning message.

[wad@hius ~/tests] arm-rtems-gcc -Os -Wall -S test.cpp
test.cpp: In member function 'int attr::create(int)':
test.cpp:17: warning: control reaches end of non-void function

the minimal testcase:

class attr
{
  attr() {}
  ~attr() {}
  int create(int);
};

int attr::create(int c)
{
  attr p;
  switch(c)
  {
    default:
      return 123;
      break;
  }
}


-- 
           Summary: [4.1.2, 4.1.1] bogus "control reaches end of non-void
                    function" warning
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wad at infinet dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31783


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