public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/rust/master] Fix warnings when including rust-target.h information
Date: Wed,  8 Jun 2022 12:05:42 +0000 (GMT)	[thread overview]
Message-ID: <20220608120542.E2AC43AAA063@sourceware.org> (raw)

https://gcc.gnu.org/g:5801e165b3902f3376387649c632933c05647274

commit 5801e165b3902f3376387649c632933c05647274
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Fri Feb 11 10:18:24 2022 +0000

    Fix warnings when including rust-target.h information

Diff:
---
 gcc/rust/rust-session-manager.cc | 20 +-------------------
 gcc/rust/rust-target.h           |  9 +++++++--
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 4e140fddb56..5529fbf6931 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -19,21 +19,6 @@
 
 #include "rust-session-manager.h"
 #include "rust-diagnostics.h"
-
-//#include "rust-target.h"
-/*TODO This isn't (currently?) necessary, but if '#include'd after '#include
-   "target.h"', causes: In file included from
-   [...]/gcc/rust/rust-session-manager.cc:31:
-    [...]/gcc/rust/rust-target.h:23: error: "DEFHOOK" redefined [-Werror]
-       23 | #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
-	  |
-    In file included from [...]/gcc/rust/rust-session-manager.cc:27:
-    [...]/gcc/target.h:272: note: this is the location of the previous
-   definition 272 | #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME)
-   PARAMS;
-	  |
-*/
-
 #include "rust-lex.h"
 #include "rust-parse.h"
 #include "rust-macro-expand.h"
@@ -47,10 +32,7 @@
 
 #include "diagnostic.h"
 #include "input.h"
-#include "target.h"
-#include "tm.h"
-#include "memmodel.h"
-#include "tm_p.h"
+#include "rust-target.h"
 
 extern bool
 saw_errors (void);
diff --git a/gcc/rust/rust-target.h b/gcc/rust/rust-target.h
index 9669c4a056f..743ac518ebb 100644
--- a/gcc/rust/rust-target.h
+++ b/gcc/rust/rust-target.h
@@ -18,9 +18,14 @@
 #ifndef GCC_RUST_TARGET_H
 #define GCC_RUST_TARGET_H
 
+#include "target.h"
+#include "tm.h"
+#include "memmodel.h"
+#include "tm_p.h"
+
 // TODO: find out what this stuff actually does
 #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
-#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
+// #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
 #define DEFHOOK_UNDOC DEFHOOK
 #define HOOKSTRUCT(FRAGMENT) FRAGMENT
 
@@ -39,4 +44,4 @@ extern struct gcc_targetrustm targetrustm;
 extern void
 rust_add_target_info (const char *key, const char *value);
 
-#endif
\ No newline at end of file
+#endif


                 reply	other threads:[~2022-06-08 12:05 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=20220608120542.E2AC43AAA063@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.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).