On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan <s...@openjdk.org> wrote:
> Hi all, > File `src/java.base/share/native/libjli/java.c` compile `error: control > reaches end of non-void function [-Werror=return-type]` with gcc options > `-fsanitize=address -O0`. The function `int JavaMain(void* _args)` in this > file missed last return statement, The original last macro statement > `LEAVE();` in this fucntion do nothing since `do {...} while (JNI_FALSE)` is > alway false and make no sense. This PR add final return statement make > function complement, I think this change almost no risk. > > Additional testing: > > - [ ] jtreg tests(include tier1/2/3 etc.) with linux-x64 release build > - [ ] jtreg tests(include tier1/2/3 etc.) with linux-x64 fastdebug build > - [ ] jtreg tests(include tier1/2/3 etc.) with linux-aarch64 release build > - [ ] jtreg tests(include tier1/2/3 etc.) with linux-aarch64 fastdebug build I think the sanitizer is just not smart enough to see that control flow can never reach beyond the do/while loop of the macro. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22355#issuecomment-2497051982