public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [pushed] Placate -Wmissing-declarations in sim/cris
Date: Sat, 19 Aug 2023 12:28:08 -0600	[thread overview]
Message-ID: <20230819182808.902012-1-tom@tromey.com> (raw)

I get a couple of -Wmissing-declarations errors when building the sim.
This happens because an earlier patch added the declarations to a
cgen-generated header, but the recent re-generation then removed them.

This patch fixes the build by adding declarations just before the
definition.  This is normally not best practice, but in this
particular situation it at leat un-breaks the build.
---
 sim/cris/cris-tmpl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c
index d1fe90641b1..b39583cdb20 100644
--- a/sim/cris/cris-tmpl.c
+++ b/sim/cris/cris-tmpl.c
@@ -261,6 +261,9 @@ MY (make_thread_cpu_data) (SIM_CPU *current_cpu, void *context)
   return info;
 }
 
+/* Placate -Wmissing-prototypes when mloop.in isn't used.  */
+void MY (f_specific_init) (SIM_CPU *current_cpu);
+
 /* Hook function for per-cpu simulator initialization.  */
 
 void
@@ -276,6 +279,13 @@ MY (f_specific_init) (SIM_CPU *current_cpu)
 #endif
 }
 \f
+/* Placate -Wmissing-prototypes when mloop.in isn't used.  */
+int MY (XCONCAT3 (f_model_crisv,BASENUM, _u_stall))
+     (SIM_CPU *current_cpu ATTRIBUTE_UNUSED,
+      const IDESC *idesc,
+      int unit_num,
+      int referenced ATTRIBUTE_UNUSED);
+
 /* Model function for arbitrary single stall cycles.  */
 
 int
-- 
2.41.0


                 reply	other threads:[~2023-08-20  0:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230819182808.902012-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).