diff options
author | Ben Gamari <ben@well-typed.com> | 2022-12-13 00:08:24 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-18 19:35:00 -0500 |
commit | 761c1f49f55afc9a9f290fafb48885c2033069ed (patch) | |
tree | e82f7265bac3c387dfab8da1dfb511df672c8140 /rts | |
parent | b3eacd64fb36724ed6c5d2d24a81211a161abef1 (diff) | |
download | haskell-761c1f49f55afc9a9f290fafb48885c2033069ed.tar.gz |
rts/libdw: Silence uninitialized usage warnings
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
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Libdw.c | 6 |
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" |