This is the mail archive of the gcc@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]

Re: Over-sensitive warning, or some quirk of C++ language rules?


On 2010-01-10, at 00:31, Dave Korn wrote:

> Simple testcase, using HEAD@155680.
> 
> ------------------------------------------------------------------------
> $ 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
> ------------------------------------------------------------------------

gcc 4.0.1, 4.2.1, and 4.3.4 don't warn about this. Looks like a regression.

-- Ross Smith


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