I propose that we patch HotSpot and start compiling with the -Wreturn-type warning. This will help us catch missing return statements earlier in the development cycle.
Warn whenever a function is defined with a return type that defaults to int. Also warn about any return statement with no return value in a function whose return type is not void (falling off the end of the function body is considered returning without a value), and about a return statement with an expression in a function whose return type is void.
For C++, a function without return type always produces a diagnostic message, even when -Wno-return-type is specified. The only exceptions are ���main��� and functions defined in system headers.
This warning is enabled by -Wall. "