public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: add __attribute__((unused)) to <arch>_fill_argbuf_tp function
@ 2023-12-14 16:21 Simon Marchi
  2023-12-14 21:39 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2023-12-14 16:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: Mike Frysinger, Simon Marchi

I get this when building with --enable-targets=all:

      CC       m32r/mloopx.o
    m32r/mloopx.c:37:1: error: ‘m32rxf_fill_argbuf_tp’ defined but not used [-Werror=unused-function]
       37 | m32rxf_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf,
          | ^~~~~~~~~~~~~~~~~~~~~

      CC       m32r/mloop2.o
    m32r/mloop2.c:37:1: error: ‘m32r2f_fill_argbuf_tp’ defined but not used [-Werror=unused-function]
       37 | m32r2f_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf,
          | ^~~~~~~~~~~~~~~~~~~~~

I don't know this code, so I didn't do an in-depth analysis of the
situation.  Adding the __attribute__((unused)) makes the warning go away
(this is what this patch does), but perhaps there's a better way or the
warning is the sign that something is wrong.

Change-Id: I5ef46b3dd790d6adf7c752ad5ba9676d4a41e043
---
 sim/common/genmloop.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index 4312dc5468f6..b466823331b5 100755
--- a/sim/common/genmloop.sh
+++ b/sim/common/genmloop.sh
@@ -336,7 +336,7 @@ static INLINE void
 
 /* Fill in tracing/profiling fields of an ARGBUF.  */
 
-static INLINE void
+__attribute__((unused)) static INLINE void
 @prefix@_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf,
 		       int trace_p, int profile_p)
 {

base-commit: f5d420bbceeb1d5065c3d91dd7c6c1e43f855ca1
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-15  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 16:21 [PATCH] sim: add __attribute__((unused)) to <arch>_fill_argbuf_tp function Simon Marchi
2023-12-14 21:39 ` Mike Frysinger
2023-12-15  2:32   ` Simon Marchi
2023-12-15  3:46     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).