Skip to content

Commit b73aa4f

Browse files
committed
AOSCOS: LOONGARCH: Suppress uninitialized warning for current_SP
Clang expects the sp variable to be initialized, but we should never do so. Signed-off-by: Bingwu Zhang <[email protected]>
1 parent 523eff1 commit b73aa4f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/hotspot/os_cpu/linux_loongarch/os_linux_loongarch.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@
7878
#define REG_FP 22
7979

8080
NOINLINE address os::current_stack_pointer() {
81-
register void *sp __asm__ ("$r3");
82-
return (address) sp;
81+
#ifdef __clang__
82+
#pragma clang diagnostic push
83+
#pragma clang diagnostic ignored "-Wuninitialized"
84+
#endif
85+
register void *sp __asm__("$r3");
86+
return (address)sp;
87+
#ifdef __clang__
88+
#pragma clang diagnostic pop
89+
#endif
8390
}
8491

8592
char* os::non_memory_address_word() {
@@ -278,9 +285,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
278285

279286
// End life with a fatal error, message and detail message and the context.
280287
// Note: no need to do any post-processing here (e.g. signal chaining)
281-
va_list va_dummy;
282-
VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
283-
va_end(va_dummy);
288+
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);
284289

285290
ShouldNotReachHere();
286291
}

0 commit comments

Comments
 (0)