RFR: 8062808: Turn on the -Wreturn-type warning
Stefan Karlsson
stefan.karlsson at oracle.com
Wed Nov 5 15:00:24 UTC 2014
On 2014-11-05 15:55, Mikael Gerdin wrote:
> Hi Stefan,
>
> On 2014-11-05 13:22, Stefan Karlsson wrote:
>> Hi all,
>>
>> I propose that we turn on the -Wreturn-type warning when compiling
>> HotSpot with GCC.
>>
>> This will help us catch missing return statements earlier in the
>> development cycle.
>
> This is an excellent step in the right direction, more than once I've
> been surprised by strange behavior only to find out that I forgot to
> add a return statement to my functions.
>
>>
>> http://cr.openjdk.java.net/~stefank/8062808/webrev.01/
>
> Looks good to me, the CHECK to THREAD change is good even in itself I
> think, since it's pointless to do
> return foo(CHECK);
> since CHECK will expand to code after an unconditional return statement.
Thanks, Mikael.
StefanK
>
> /Mikael
>
>> https://bugs.openjdk.java.net/browse/JDK-8062808
>>
>> thanks,
>> StefanK
More information about the hotspot-dev
mailing list