This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++: warn about missing return statement
>>>>> Martin v Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
>> How is this an improvement over the existing -Wreturn-type?
> It is always activated. We had two reports in a day that g++ would not
> reject functions with no return statement.
> The request was that -Wreturn-type is always activated. I thought that
> this might give too many false warnings (are they positive or
> negative?). The new warning would always be correct.
Not necessarily:
int stub ()
{
my_abort ();
}
would still get a false positive. My inclination would be just to turn on
-Wreturn-type by default.
Jason