openrisc_sim.c:87:42: error: 'cpu_irqs[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Bug #1874073 reported by
Martin Liska
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Philippe Mathieu-Daudé |
Bug Description
I see the warning since gcc10:
static void openrisc_
...
qemu_irq *cpu_irqs[2];
...
serial_
I would initialize cpu_irqs[2] with {}.
Changed in qemu: | |
status: | New → Confirmed |
Changed in qemu: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Suggested patch:
diff --git a/hw/openrisc/ openrisc_ sim.c b/hw/openrisc/ openrisc_ sim.c openrisc_ sim.c openrisc_ sim.c sim_init( MachineState *machine) >kernel_ filename;
index 79e7049..724dcd0 100644
--- a/hw/openrisc/
+++ b/hw/openrisc/
@@ -129,7 +129,7 @@ static void openrisc_
const char *kernel_filename = machine-
OpenRISCCPU *cpu = NULL;
MemoryRegion *ram;
- qemu_irq *cpu_irqs[2];
+ qemu_irq *cpu_irqs[2] = {};
qemu_irq serial_irq;
int n;
unsigned int smp_cpus = machine->smp.cpus;