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.
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])