From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id D874138560A9; Thu, 2 Jun 2022 15:29:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D874138560A9 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] ODR warning for "struct instruction_type" X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 94e079e76e71951a97f74a61513a7b71adaa2a90 X-Git-Newrev: cc55e4ef62f102c4aff3b34ee2a134cdcc734897 Message-Id: <20220602152918.D874138560A9@sourceware.org> Date: Thu, 2 Jun 2022 15:29:18 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2022 15:29:19 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dcc55e4ef62f1= 02c4aff3b34ee2a134cdcc734897 commit cc55e4ef62f102c4aff3b34ee2a134cdcc734897 Author: Tom Tromey Date: Wed May 18 09:45:33 2022 -0600 ODR warning for "struct instruction_type" =20 "struct instruction_type" is defined in multiple .c files, causing an ODR warning. This patch renames the types. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D22395 Diff: --- gdb/ia64-tdep.c | 8 ++++---- gdb/z80-tdep.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index dd6d5b199b2..82456dc9c98 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -75,7 +75,7 @@ static gdb::optional ktab_buf; =20 /* An enumeration of the different IA-64 instruction types. */ =20 -enum instruction_type +enum ia64_instruction_type { A, /* Integer ALU ; I-unit or M-unit */ I, /* Non-ALU integer; I-unit */ @@ -470,7 +470,7 @@ replace_slotN_contents (gdb_byte *bundle, long long ins= tr, int slotnum) replace_bit_field (bundle, instr, 5+41*slotnum, 41); } =20 -static const enum instruction_type template_encoding_table[32][3] =3D +static const enum ia64_instruction_type template_encoding_table[32][3] =3D { { M, I, I }, /* 00 */ { M, I, I }, /* 01 */ @@ -510,7 +510,7 @@ static const enum instruction_type template_encoding_ta= ble[32][3] =3D address of the next instruction to fetch. */ =20 static CORE_ADDR -fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr) +fetch_instruction (CORE_ADDR addr, ia64_instruction_type *it, long long *i= nstr) { gdb_byte bundle[BUNDLE_LEN]; int slotnum =3D (int) (addr & 0x0f) / SLOT_MULTIPLIER; @@ -1363,7 +1363,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, { CORE_ADDR next_pc; CORE_ADDR last_prologue_pc =3D pc; - instruction_type it; + ia64_instruction_type it; long long instr; int cfm_reg =3D 0; int ret_reg =3D 0; diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index c2d906d1402..196884af770 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -109,7 +109,7 @@ struct z80_unwind_cache struct trad_frame_saved_reg *saved_regs; }; =20 -enum instruction_type +enum z80_instruction_type { insn_default, insn_z80, @@ -144,7 +144,7 @@ struct insn_info gdb_byte code; gdb_byte mask; gdb_byte size; /* without prefix(es) */ - enum instruction_type type; + enum z80_instruction_type type; }; =20 /* Constants */