RFR: 8062808: Turn on the -Wreturn-type warning
Mikael Gerdin
mikael.gerdin at oracle.com
Wed Nov 5 14:55:04 UTC 2014
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.
/Mikael
> https://bugs.openjdk.java.net/browse/JDK-8062808
>
> thanks,
> StefanK
More information about the hotspot-dev
mailing list