aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-03 03:38:35 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-08 20:13:22 -0500
commit92bdeb2888729eec6e699ef1cf5c3fc4c2db886e (patch)
treeb8652d453ea7d9b150d17a13e41870f4b4a4590b /sim
parent9f17cdda31504ee821112a88323306cc81ac93cf (diff)
downloadgdb-92bdeb2888729eec6e699ef1cf5c3fc4c2db886e.zip
gdb-92bdeb2888729eec6e699ef1cf5c3fc4c2db886e.tar.gz
gdb-92bdeb2888729eec6e699ef1cf5c3fc4c2db886e.tar.bz2
sim: ppc: workaround uninitialized variable compiler warnings
Some compilers don't understand the semctl API and think it's an input argument even when it's used as an output, and then complains that it is being used uninitialized. Zero it out explicitly to workaround it. This adds some runtime overhead, but should be fairly minor as it's a small stack buffer, and shouldn't be that relevant relative to all the other logic in these functions.
Diffstat (limited to 'sim')
-rw-r--r--sim/ppc/hw_sem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/ppc/hw_sem.c b/sim/ppc/hw_sem.c
index c43af3b..9495b85 100644
--- a/sim/ppc/hw_sem.c
+++ b/sim/ppc/hw_sem.c
@@ -111,7 +111,7 @@ hw_sem_init_data(device *me)
hw_sem_device *sem = (hw_sem_device*)device_data(me);
const device_unit *d;
int status;
- union semun help;
+ union semun help = {};
/* initialize the properties of the sem */
@@ -190,7 +190,7 @@ hw_sem_io_read_buffer(device *me,
struct sembuf sb;
int status;
uint32_t u32;
- union semun help;
+ union semun help = {};
/* do we need to worry about out of range addresses? */