summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2022-12-13 00:08:24 +0000
committerBen Gamari <ben@well-typed.com>2022-12-13 00:08:24 +0000
commit66e16022e2345dfe680deb77886d05f3dcefa861 (patch)
tree756d7b7ed30bcd7c8be76b198d37429937b1e0b8
parentc30accc2f8a0585c76cb534beda04fba624bce1c (diff)
downloadhaskell-wip/T22538.tar.gz
rts/libdw: Silence uninitialized usage warningswip/T22538
As noted in #22538, previously some GCC versions warned that various locals in Libdw.c may be used uninitialized. Although this wasn't strictly true (since they were initialized in an inline assembler block) we fix this by providing explicit empty initializers. Fixes #22538
-rw-r--r--rts/Libdw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/Libdw.c b/rts/Libdw.c
index 335d99861b..3243979fd3 100644
--- a/rts/Libdw.c
+++ b/rts/Libdw.c
@@ -290,7 +290,7 @@ static bool set_initial_registers(Dwfl_Thread *thread, void *arg);
#if defined(x86_64_HOST_ARCH)
static bool set_initial_registers(Dwfl_Thread *thread,
void *arg STG_UNUSED) {
- Dwarf_Word regs[17];
+ Dwarf_Word regs[17] = {};
__asm__ ("movq %%rax, 0x00(%0)\n\t"
"movq %%rdx, 0x08(%0)\n\t"
"movq %%rcx, 0x10(%0)\n\t"
@@ -318,7 +318,7 @@ static bool set_initial_registers(Dwfl_Thread *thread,
#elif defined(i386_HOST_ARCH)
static bool set_initial_registers(Dwfl_Thread *thread,
void *arg STG_UNUSED) {
- Dwarf_Word regs[9];
+ Dwarf_Word regs[9] = {};
__asm__ ("movl %%eax, 0x00(%0)\n\t"
"movl %%ecx, 0x04(%0)\n\t"
"movl %%edx, 0x08(%0)\n\t"
@@ -339,7 +339,7 @@ static bool set_initial_registers(Dwfl_Thread *thread,
#elif defined(s390x_HOST_ARCH)
static bool set_initial_registers(Dwfl_Thread *thread,
void *arg STG_UNUSED) {
- Dwarf_Word regs[32];
+ Dwarf_Word regs[32] = {};
__asm__ ("stmg %%r0,%%r15,0(%0)\n\t"
"std %%f0, 128(0,%0)\n\t"
"std %%f2, 136(0,%0)\n\t"