From: Mike Frysinger Date: Sat, 6 Nov 2021 16:52:00 +0000 (-0400) Subject: sim: sh: fix unused-value warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7256320b9531e8af14ef75a42c09c47161be1480;p=binutils-gdb.git sim: sh: fix unused-value warnings These macro expansions are deliberate in not using the computed value so that they trigger side-effects (possible invalid memory accesses) but while otherwise being noops. Add a (void) cast so the compiler knows these are intentional. --- diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index c922cfe43b9..ae44bc8825b 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -1239,17 +1239,17 @@ static op tab[] = }, { "", "n", "ocbi @", "0000nnnn10010011", - "RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", + "(void) RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", "/* FIXME: Cache not implemented */", }, { "", "n", "ocbp @", "0000nnnn10100011", - "RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", + "(void) RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", "/* FIXME: Cache not implemented */", }, { "", "n", "ocbwb @", "0000nnnn10110011", - "RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", + "(void) RSBAT (R[n]); /* Take exceptions like byte load, otherwise noop. */", "/* FIXME: Cache not implemented */", },