From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id BFA21385801A for ; Thu, 18 Nov 2021 20:50:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BFA21385801A X-ASG-Debug-ID: 1637268653-0c856e2e47179400001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id CmlATCOriSzoTYmq (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2021 15:50:53 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id C2941441D64; Thu, 18 Nov 2021 15:50:53 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/2] gdb: fix ia64-tdep.c build with g++ 4.8 Date: Thu, 18 Nov 2021 15:50:52 -0500 X-ASG-Orig-Subj: [PATCH 1/2] gdb: fix ia64-tdep.c build with g++ 4.8 Message-Id: <20211118205053.2429353-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1637268653 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2423 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.94047 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-19.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 18 Nov 2021 20:50:59 -0000 When building with g++ 4.8, I get: CXX ia64-tdep.o /home/smarchi/src/binutils-gdb/gdb/ia64-tdep.c:3862:1: error: could not convert '{ia64_allocate_new_rse_frame, ia64_store_argument_in_slot, ia64_set_function_addr}' from '' to 'const ia64_infcall_ops' }; ^ This happens since commit 345bd07cce3 ("gdb: fix gdbarch_tdep ODR violation"), which added default values for ia64_infcall_ops fields. It looks like g++ 4.8 doesn't like initializing the ia64_infcall_ops object using the brace-enclosed initializer list when the ia64_infcall_ops fields are assigned default values. Later compilers don't have a problem with that, so I suppose that the code is correct, but still, change it to make gcc 4.8 happy. Don't initialize the fields of ia64_infcall_ops directly, instead default-initialize ia64_gdbarch_tdep::infcall_ops. Change-Id: I35e3a61abd7b7bbcafe6cb207078c738c5266d76 --- gdb/ia64-tdep.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/ia64-tdep.h b/gdb/ia64-tdep.h index 82319d50894..d831484ee57 100644 --- a/gdb/ia64-tdep.h +++ b/gdb/ia64-tdep.h @@ -216,18 +216,17 @@ struct ia64_infcall_ops Should do nothing if this operation is not permitted by the OS. */ void (*allocate_new_rse_frame) (struct regcache *regcache, ULONGEST bsp, - int sof) = nullptr; + int sof); /* Store the argument stored in BUF into the appropriate location given the BSP and the SLOTNUM. */ void (*store_argument_in_slot) (struct regcache *regcache, CORE_ADDR bsp, - int slotnum, gdb_byte *buf) = nullptr; + int slotnum, gdb_byte *buf); /* For targets where we cannot call the function directly, store the address of the function we want to call at the location expected by the calling sequence. */ - void (*set_function_addr) (struct regcache *regcache, CORE_ADDR func_addr) - = nullptr; + void (*set_function_addr) (struct regcache *regcache, CORE_ADDR func_addr); }; struct ia64_gdbarch_tdep : gdbarch_tdep @@ -255,7 +254,7 @@ struct ia64_gdbarch_tdep : gdbarch_tdep /* ISA-specific data types. */ struct type *ia64_ext_type = nullptr; - struct ia64_infcall_ops infcall_ops; + struct ia64_infcall_ops infcall_ops {}; }; extern void ia64_write_pc (struct regcache *, CORE_ADDR); -- 2.33.1