* [pushed] gdb: remove unnecessary struct typedef in sparc64-tdep.c
@ 2020-05-16 2:18 Simon Marchi
0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-05-16 2:18 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
When building with clang 11, I get:
CXX sparc64-tdep.o
/home/smarchi/src/binutils-gdb/gdb/sparc64-tdep.c:89:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]
typedef struct
^
adi_stat_t
/home/smarchi/src/binutils-gdb/gdb/sparc64-tdep.c:103:16: note: type is not C-compatible due to this default member initializer
int tag_fd = 0;
^
/home/smarchi/src/binutils-gdb/gdb/sparc64-tdep.c:111:3: note: type is given name 'adi_stat_t' for linkage purposes by this typedef declaration
} adi_stat_t;
^
The typedef is not needed in C++ anyway, just remove them.
gdb/ChangeLog:
* sparc64-tdep.c (adi_stat_t): Remove typedef (leaving struct).
(sparc64_adi_info): Likewise.
---
gdb/ChangeLog | 5 +++++
gdb/sparc64-tdep.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7b19973118a5..0e8e47d8d222 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-15 Simon Marchi <simon.marchi@efficios.com>
+
+ * sparc64-tdep.c (adi_stat_t): Remove typedef (leaving struct).
+ (sparc64_adi_info): Likewise.
+
2020-05-15 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_language_this, lookup_symbol_aux): Use
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 39ba455e6fb1..ce323c704dad 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -86,7 +86,7 @@
static struct cmd_list_element *sparc64adilist = NULL;
/* ADI stat settings. */
-typedef struct
+struct adi_stat_t
{
/* The ADI block size. */
unsigned long blksize;
@@ -108,11 +108,11 @@ typedef struct
/* ADI is available. */
bool is_avail = false;
-} adi_stat_t;
+};
/* Per-process ADI stat info. */
-typedef struct sparc64_adi_info
+struct sparc64_adi_info
{
sparc64_adi_info (pid_t pid_)
: pid (pid_)
@@ -124,7 +124,7 @@ typedef struct sparc64_adi_info
/* The ADI stat. */
adi_stat_t stat = {};
-} sparc64_adi_info;
+};
static std::forward_list<sparc64_adi_info> adi_proc_list;
--
2.26.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-16 2:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16 2:18 [pushed] gdb: remove unnecessary struct typedef in sparc64-tdep.c Simon Marchi
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).