diff options
author | Tom de Vries <tdevries@suse.de> | 2021-05-19 18:42:59 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-05-19 18:42:59 +0200 |
commit | bfff0efb3d8283a48825abc1701bb39a56d223c5 (patch) | |
tree | 15d31e334d8ee55cfbee07e519457ce3885defd7 /sim/ppc/emul_netbsd.c | |
parent | 0d7e3cd15fa770e172f442e1a984809fa8ac0fdc (diff) | |
download | gdb-bfff0efb3d8283a48825abc1701bb39a56d223c5.zip gdb-bfff0efb3d8283a48825abc1701bb39a56d223c5.tar.gz gdb-bfff0efb3d8283a48825abc1701bb39a56d223c5.tar.bz2 |
sim: ppc: fix Wnonnull warning
When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into:
...
src/sim/ppc/emul_netbsd.c: In function 'do_gettimeofday':
src/sim/ppc/emul_netbsd.c:770:16: error: null argument where non-null \
required (argument 1) [-Werror=nonnull]
int status = gettimeofday((t_addr != 0 ? &t : NULL),
^~~~~~~~~~~~
...
Fix this by unconditionally passing &t as first argument.
Diffstat (limited to 'sim/ppc/emul_netbsd.c')
-rw-r--r-- | sim/ppc/emul_netbsd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 0135a93..4d9f32d 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -767,8 +767,7 @@ do_gettimeofday(os_emul_data *emul, unsigned_word tz_addr = cpu_registers(processor)->gpr[arg0+1]; struct timeval t; struct timezone tz; - int status = gettimeofday((t_addr != 0 ? &t : NULL), - (tz_addr != 0 ? &tz : NULL)); + int status = gettimeofday(&t, (tz_addr != 0 ? &tz : NULL)); int err = errno; if (WITH_TRACE && ppc_trace[trace_os_emul]) |