Duplicate :
|
|
Relates :
|
|
Relates :
|
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. From: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html "-Wreturn-type 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. "
|