From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id 742B33851416 for ; Wed, 18 May 2022 18:00:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 742B33851416 Received: by mail-io1-xd31.google.com with SMTP id o190so3123395iof.10 for ; Wed, 18 May 2022 11:00:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yfuJFILhFvdV/y4kSKY/18A4UFwehy/k45vyXH+0euU=; b=DuV2W27XESIc5AUWdJX2Jz+X0bfGfF2tNeCLv2zhSauADi0Plwcxdvfw68GoYiulHn H767DLLAg4XlFIrWBpDyK7mJmpQf2LBZMxVZTgdUaPhu0LVkayuV01VWUqzH30BBPiih WMwNIPg8hk3QANlKM0rMRkTOl3lpD+0n6xxeu+4nETVd3/chZ+xmEzjsv5ewHXECMH6Q /iOj6Ky9kpVYHdjRasBMVSoeF/oSqr1OCLPmzsbE8Ti/PURQ3tF/a1KRhexPOotZpQIp 2/38oZFWzE9v8MTvVEX4YSq87Eogz6jeLXsMM8hI36tYMw3ltmR/TUYlj+YuBmWd2pkZ Mnfw== X-Gm-Message-State: AOAM532VWBh/Ipsl3swOWjKZFVcXIVxmGQGY3fOKsKV/J1fmNqkxES9Y xHjN4eEJOfSssFyo3FjkcDtaH3ZBsSi3zg== X-Google-Smtp-Source: ABdhPJwhtysUM9RR0qQhgTNSFXH4heo0gV5s6/ePVPrKNxsltKPbuAFdfQge6YDBTsoVLNukhhXQFQ== X-Received: by 2002:a05:6638:3287:b0:32b:5df3:c515 with SMTP id f7-20020a056638328700b0032b5df3c515mr440184jav.48.1652896858762; Wed, 18 May 2022 11:00:58 -0700 (PDT) Received: from murgatroyd.Home (71-211-158-194.hlrn.qwest.net. [71.211.158.194]) by smtp.gmail.com with ESMTPSA id r4-20020a92d984000000b002cde6e352ffsm715083iln.73.2022.05.18.11.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 11:00:58 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 06/14] ODR warning for "struct instruction_type" Date: Wed, 18 May 2022 12:00:41 -0600 Message-Id: <20220518180049.2337257-7-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220518180049.2337257-1-tromey@adacore.com> References: <20220518180049.2337257-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 18:01:00 -0000 "struct instruction_type" is defined in multiple .c files, causing an ODR warning. This patch renames the types. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395 --- 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; /* An enumeration of the different IA-64 instruction types. */ -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 instr, int slotnum) replace_bit_field (bundle, instr, 5+41*slotnum, 41); } -static const enum instruction_type template_encoding_table[32][3] = +static const enum ia64_instruction_type template_encoding_table[32][3] = { { M, I, I }, /* 00 */ { M, I, I }, /* 01 */ @@ -510,7 +510,7 @@ static const enum instruction_type template_encoding_table[32][3] = address of the next instruction to fetch. */ 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 *instr) { gdb_byte bundle[BUNDLE_LEN]; int slotnum = (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 = pc; - instruction_type it; + ia64_instruction_type it; long long instr; int cfm_reg = 0; int ret_reg = 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; }; -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; }; /* Constants */ -- 2.34.1