public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] ODR warning for "struct find_targ_sec_arg"
@ 2022-06-02 15:29 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-06-02 15:29 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ddfc4ef12441bef95ea0bf0a2fb68fe58e24440a
commit ddfc4ef12441bef95ea0bf0a2fb68fe58e24440a
Author: Tom Tromey <tromey@adacore.com>
Date: Wed May 18 09:51:10 2022 -0600
ODR warning for "struct find_targ_sec_arg"
"struct find_targ_sec_arg" is defined in multiple .c files, causing
ODR warnings. This patch renames the types.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
Diff:
---
gdb/coffread.c | 8 ++++----
gdb/xcoffread.c | 7 ++++---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 75cf646c980..474a1aa02f5 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -254,7 +254,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
/* Return the section_offsets* that CS points to. */
static int cs_to_section (struct coff_symbol *, struct objfile *);
-struct find_targ_sec_arg
+struct coff_find_targ_sec_arg
{
int targ_index;
asection **resultp;
@@ -263,7 +263,7 @@ struct find_targ_sec_arg
static void
find_targ_sec (bfd *abfd, asection *sect, void *obj)
{
- struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
+ struct coff_find_targ_sec_arg *args = (struct coff_find_targ_sec_arg *) obj;
if (sect->target_index == args->targ_index)
*args->resultp = sect;
@@ -274,7 +274,7 @@ static struct bfd_section*
cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile)
{
asection *sect = NULL;
- struct find_targ_sec_arg args;
+ struct coff_find_targ_sec_arg args;
args.targ_index = cs->c_secnum;
args.resultp = §
@@ -301,7 +301,7 @@ static CORE_ADDR
cs_section_address (struct coff_symbol *cs, bfd *abfd)
{
asection *sect = NULL;
- struct find_targ_sec_arg args;
+ struct coff_find_targ_sec_arg args;
CORE_ADDR addr = 0;
args.targ_index = cs->c_secnum;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 9adc841b1f1..250bd9f4a94 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -249,7 +249,7 @@ static void process_linenos (CORE_ADDR, CORE_ADDR);
static int secnum_to_section (int, struct objfile *);
static asection *secnum_to_bfd_section (int, struct objfile *);
-struct find_targ_sec_arg
+struct xcoff_find_targ_sec_arg
{
int targ_index;
int *resultp;
@@ -262,7 +262,8 @@ static void find_targ_sec (bfd *, asection *, void *);
static void
find_targ_sec (bfd *abfd, asection *sect, void *obj)
{
- struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
+ struct xcoff_find_targ_sec_arg *args
+ = (struct xcoff_find_targ_sec_arg *) obj;
struct objfile *objfile = args->objfile;
if (sect->target_index == args->targ_index)
@@ -290,7 +291,7 @@ static void
xcoff_secnum_to_sections (int n_scnum, struct objfile *objfile,
asection **bfd_sect, int *secnum)
{
- struct find_targ_sec_arg args;
+ struct xcoff_find_targ_sec_arg args;
args.targ_index = n_scnum;
args.resultp = secnum;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-02 15:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 15:29 [binutils-gdb] ODR warning for "struct find_targ_sec_arg" Tom Tromey
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).