From fc63d75ab3d3989b84af3817f8169adc2dfe36b2 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 26 Nov 1997 19:19:58 +0000 Subject: [PATCH] * syscall.c (cb_syscall, cases stat, fstat): Handle -Wall -Werror. --- sim/common/ChangeLog | 4 ++++ sim/common/syscall.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 7715b5b142d..c3b7528c3d2 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +Wed Nov 26 11:18:40 1997 Doug Evans + + * syscall.c (cb_syscall, cases stat, fstat): Handle -Wall -Werror. + Tue Nov 25 20:12:46 1997 Michael Meissner * sim-io.c (sim_io_syscalls): Disable lseek. diff --git a/sim/common/syscall.c b/sim/common/syscall.c index 4f0c96c7869..fbeb24cb378 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -390,7 +390,10 @@ cb_syscall (cb, sc) result = -1; goto FinishSyscall; } - if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != buflen) + /* ??? Coercion to unsigned avoids -Wall -Werror failure. + Ya, cb_host_to_target_stat could return an unsigned int, + but that seems worse. */ + if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != (unsigned) buflen) { free (buf); errcode = EINVAL; @@ -422,7 +425,10 @@ cb_syscall (cb, sc) result = -1; goto FinishSyscall; } - if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != buflen) + /* ??? Coercion to unsigned avoids -Wall -Werror failure. + Ya, cb_host_to_target_stat could return an unsigned int, + but that seems worse. */ + if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != (unsigned) buflen) { free (buf); errcode = EINVAL; -- 2.30.2