This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Over-sensitive warning, or some quirk of C++ language rules?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ross Smith <r-smith at ihug dot co dot nz>
- Cc: GCC mailing list <gcc at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>
- Date: Sat, 9 Jan 2010 08:07:22 -0800
- Subject: Re: Over-sensitive warning, or some quirk of C++ language rules?
- References: <4B486914.8080905@gmail.com> <53F45869-B381-468F-B297-37C7CAFFDA81@ihug.co.nz>
On Sat, Jan 9, 2010 at 4:17 AM, Ross Smith <r-smith@ihug.co.nz> wrote:
> 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
>
>
It is caused by revision 138140:
http://gcc.gnu.org/ml/gcc-cvs/2008-07/msg00852.html
--
H.J.