RFR: 8062808: Turn on the -Wreturn-type warning

Kim Barrett kim.barrett at oracle.com
Wed Nov 5 21:35:13 UTC 2014


On Nov 5, 2014, at 4:22 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:
> 
> Rather than have all this, why not have report_should_not_reach_here() have the NORETURN_ATTRIBUTE.

I was recently wondering about that myself, in response to that recently wasted half day.

It turns out that report_should_not_reach_here() - and anything else built on report_vm_error() - cannot presently be noreturn, because report_vm_error() is not noreturn; it starts with:

 if (Debugging || error_is_suppressed(file, line)) return;

report_vm_out_of_memory() similarly starts with

 if (Debugging) return;

Calls to these report functions typically seem to be followed by “BREAKPOINT;”.  I don’t really understand the design here, e.g. why not move that into the place where the returns are located in the report functions?  I expect there’s a reason, but I haven’t puzzled it out.



More information about the hotspot-dev mailing list