From 761c1f49f55afc9a9f290fafb48885c2033069ed Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 13 Dec 2022 00:08:24 +0000 Subject: 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 --- rts/Libdw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rts') 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" -- cgit v1.2.1