[PATCH 2/6] sim: sh: fix unused-value warnings

Mike Frysinger vapier@gentoo.org
Sun Nov 7 00:32:50 GMT 2021


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.
---
 sim/sh/gencode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index c922cfe43b96..ae44bc8825b8 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -1239,17 +1239,17 @@ static op tab[] =
   },
 
   { "", "n", "ocbi @<REG_N>", "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 @<REG_N>", "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 @<REG_N>", "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 */",
   },
 
-- 
2.33.0



More information about the Gdb-patches mailing list