Simple testcase not even worth attaching preprocessed source for, using
h...@155680.  Note that this only arises in C++, not when compiled as C:

------------------------------------------------------------------------
$ cat badwarn.cpp

extern void bar (void);
int foo (void) __attribute__ ((__noreturn__));

int
foo (void)
{
  while (1)
  {
    bar ();
  }
}

$ g++-4 -c badwarn.cpp  -Wall
badwarn.cpp: In function 'int foo()':
badwarn.cpp:12:1: warning: no return statement in function returning non-void
------------------------------------------------------------------------

Discussed on the list at http://gcc.gnu.org/ml/gcc/2010-01/threads.html#00180;
Ross Smith identified this as a regression as it does not arise with 4.0.1,
4.2.1 and 4.3.4, and HJ tracked it to r.138140:

http://gcc.gnu.org/ml/gcc-cvs/2008-07/msg00852.html


-- 
           Summary: Bogus "no return statement in function returning non-
                    void" warning
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davek at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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

Reply via email to