On 04/03/2018 10:26 AM, dave.pa...@oracle.com wrote:
This patch fixes handlng of -Werror=return-type. Currently, even with
the flag specified, return type errors remain warnings.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
Function c_finish_return (), when calling pedwarn, should specifiy
OPT_Wreturn_type as the diagnostic index if warn_return_type is set so
that the given diagnostic is generated as an error, not a warning.
Patch was successfully bootstrapped and tested on x86_64-linux.
I would expect the option to control the warning consistently so
that when the test case is compiled with just -Wno-return-type
(and no other options) the warning is not issued. But that's not
what happens because pedwarn() is called with a zero argument as
the option.
Martin