Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0 [v2]

2025-04-05 Thread SendaoYan
> 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 > will execute return ret in LEAVE() macro, but gcc with -O0 is

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2025-04-05 Thread SendaoYan
On Mon, 31 Mar 2025 12:57:38 GMT, Magnus Ihse Bursie wrote: > While I normally advocate using DISABLE_WARNING in makefiles instead of > pragmas, in this particular case I wonder if not a pragma in the `LEAVE` > macro would be better? PR has been changed to use `#pragma GCC diagnostic ignored "

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2025-04-04 Thread SendaoYan
On Mon, 31 Mar 2025 12:57:38 GMT, Magnus Ihse Bursie 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 fil

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0 [v3]

2025-04-02 Thread Julian Waters
On Tue, 1 Apr 2025 12:07:09 GMT, SendaoYan 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 >> will

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0 [v3]

2025-04-01 Thread Magnus Ihse Bursie
On Tue, 1 Apr 2025 12:07:09 GMT, SendaoYan 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 >> will

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0 [v3]

2025-04-01 Thread SendaoYan
> 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 > will execute return ret in LEAVE() macro, but gcc with -O0 is

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2025-03-31 Thread SendaoYan
On Mon, 31 Mar 2025 12:57:38 GMT, Magnus Ihse Bursie wrote: > in this particular case I wonder if not a pragma in the LEAVE macro would be > better? I will try it later. - PR Comment: https://git.openjdk.org/jdk/pull/24318#issuecomment-2766150226

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2025-03-31 Thread Magnus Ihse Bursie
On Sun, 30 Mar 2025 15:07:36 GMT, SendaoYan 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 > will exe

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-25 Thread SendaoYan
On Tue, 26 Nov 2024 02:12:39 GMT, David Holmes wrote: > may trigger an unreachable statement warning in a smarter compiler. Agree. I will close this PR and the related issue as won't fix. - PR Comment: https://git.openjdk.org/jdk/pull/22355#issuecomment-2499500253

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-25 Thread David Holmes
On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan 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

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-25 Thread SendaoYan
On Mon, 25 Nov 2024 07:11:25 GMT, Jaikiran Pai wrote: > Do you mean that the `if (JNI_TRUE)` block which has the `return ret;` > wouldn't be used by the preprocessor when using `-O0`? I make a misunderstand for the do-while(false) loop prior. Actually the do-while(false) loop will execute at l

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-25 Thread SendaoYan
On Mon, 25 Nov 2024 07:08:56 GMT, David Holmes 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

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-25 Thread SendaoYan
On Mon, 25 Nov 2024 07:19:54 GMT, David Holmes wrote: > 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. I think you are right, the sanitizer of gcc is not smart enough at some situations. I found the similar code

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-24 Thread SendaoYan
On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan 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

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-24 Thread David Holmes
On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan 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

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-24 Thread Jaikiran Pai
On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan 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

Re: RFR: 8304674: File java.c compile error with -fsanitize=address -O0

2024-11-24 Thread David Holmes
On Mon, 25 Nov 2024 06:17:23 GMT, SendaoYan 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