From patchwork Thu Aug 25 11:56:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 14926 Received: (qmail 78206 invoked by alias); 25 Aug 2016 11:56:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 78096 invoked by uid 89); 25 Aug 2016 11:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=xtensa, pc_regnum, H*o:Research, states X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Aug 2016 11:56:33 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7PBsxtD100281 for ; Thu, 25 Aug 2016 07:56:31 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0b-001b2d01.pphosted.com with ESMTP id 251b8rrybw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 25 Aug 2016 07:56:31 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Aug 2016 12:56:29 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Aug 2016 12:56:28 +0100 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 948151B08061 for ; Thu, 25 Aug 2016 12:58:07 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7PBuRXV12648568 for ; Thu, 25 Aug 2016 11:56:27 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7PBuQqI013894 for ; Thu, 25 Aug 2016 05:56:27 -0600 Received: from oc1027705133.ibm.com (dyn-9-152-212-131.boeblingen.de.ibm.com [9.152.212.131]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u7PBuPaY013822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Aug 2016 05:56:26 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH] xtensa: Avoid designated inits, for C++ compliance Date: Thu, 25 Aug 2016 13:56:25 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082511-0032-0000-0000-00000201409A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082511-0033-0000-0000-00001C83F0AF Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-25_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608250147 X-IsSubscribed: yes C++ does not officially support designators in initializer lists. Thus some compilers may issue errors when encountering them. Modern versions of GCC seem to allow them by default, as a GCC extension, even though the GCC documentation explicitly states otherwise: "[...] This extension is not implemented in GNU C++." But some older GCC versions (like 4.4.7) did indeed emit an error instead, like this: .../gdb/xtensa-config.c:219: error: expected primary-expression before ‘.’ token This patch removes the only such instance I've seen when building with '--enable-targets=all'. gdb/ChangeLog: * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Replace designated initializer list by plain initializer list, for C++ compliance. --- gdb/xtensa-tdep.h | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index b2b1903..c83e312 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -224,55 +224,55 @@ struct gdbarch_tdep /* Macro to instantiate a gdbarch_tdep structure. */ -#define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz) \ - { \ - .target_flags = 0, \ - .spill_location = -1, \ - .spill_size = (spillsz), \ - .unused = 0, \ - .call_abi = (XSHAL_ABI == XTHAL_ABI_CALL0 \ - ? CallAbiCall0Only \ - : CallAbiDefault), \ - .debug_interrupt_level = XCHAL_DEBUGLEVEL, \ - .icache_line_bytes = XCHAL_ICACHE_LINESIZE, \ - .dcache_line_bytes = XCHAL_DCACHE_LINESIZE, \ - .dcache_writeback = XCHAL_DCACHE_IS_WRITEBACK, \ - .isa_use_windowed_registers = (XSHAL_ABI != XTHAL_ABI_CALL0), \ - .isa_use_density_instructions = XCHAL_HAVE_DENSITY, \ - .isa_use_exceptions = XCHAL_HAVE_EXCEPTIONS, \ - .isa_use_ext_l32r = XSHAL_USE_ABSOLUTE_LITERALS, \ - .isa_max_insn_size = XCHAL_MAX_INSTRUCTION_SIZE, \ - .debug_num_ibreaks = XCHAL_NUM_IBREAK, \ - .debug_num_dbreaks = XCHAL_NUM_DBREAK, \ - .regmap = rmap, \ - .num_regs = 0, \ - .num_nopriv_regs = 0, \ - .num_pseudo_regs = 0, \ - .num_aregs = XCHAL_NUM_AREGS, \ - .num_contexts = XCHAL_NUM_CONTEXTS, \ - .ar_base = -1, \ - .a0_base = -1, \ - .wb_regnum = -1, \ - .ws_regnum = -1, \ - .pc_regnum = -1, \ - .ps_regnum = -1, \ - .lbeg_regnum = -1, \ - .lend_regnum = -1, \ - .lcount_regnum = -1, \ - .sar_regnum = -1, \ - .litbase_regnum = -1, \ - .interrupt_regnum = -1, \ - .interrupt2_regnum = -1, \ - .cpenable_regnum = -1, \ - .debugcause_regnum = -1, \ - .exccause_regnum = -1, \ - .excvaddr_regnum = -1, \ - .max_register_raw_size = 0, \ - .max_register_virtual_size = 0, \ - .fp_layout = 0, \ - .fp_layout_bytes = 0, \ - .gregmap = 0, \ - } +#define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz) \ + { \ + 0, /* target_flags */ \ + -1, /* spill_location */ \ + (spillsz), /* spill_size */ \ + 0, /* unused */ \ + (XSHAL_ABI == XTHAL_ABI_CALL0 \ + ? CallAbiCall0Only \ + : CallAbiDefault), /* call_abi */ \ + XCHAL_DEBUGLEVEL, /* debug_interrupt_level */ \ + XCHAL_ICACHE_LINESIZE, /* icache_line_bytes */ \ + XCHAL_DCACHE_LINESIZE, /* dcache_line_bytes */ \ + XCHAL_DCACHE_IS_WRITEBACK, /* dcache_writeback */ \ + (XSHAL_ABI != XTHAL_ABI_CALL0), /* isa_use_windowed_registers */ \ + XCHAL_HAVE_DENSITY, /* isa_use_density_instructions */ \ + XCHAL_HAVE_EXCEPTIONS, /* isa_use_exceptions */ \ + XSHAL_USE_ABSOLUTE_LITERALS, /* isa_use_ext_l32r */ \ + XCHAL_MAX_INSTRUCTION_SIZE, /* isa_max_insn_size */ \ + XCHAL_NUM_IBREAK, /* debug_num_ibreaks */ \ + XCHAL_NUM_DBREAK, /* debug_num_dbreaks */ \ + rmap, /* regmap */ \ + 0, /* num_regs */ \ + 0, /* num_nopriv_regs */ \ + 0, /* num_pseudo_regs */ \ + XCHAL_NUM_AREGS, /* num_aregs */ \ + XCHAL_NUM_CONTEXTS, /* num_contexts */ \ + -1, /* ar_base */ \ + -1, /* a0_base */ \ + -1, /* wb_regnum */ \ + -1, /* ws_regnum */ \ + -1, /* pc_regnum */ \ + -1, /* ps_regnum */ \ + -1, /* lbeg_regnum */ \ + -1, /* lend_regnum */ \ + -1, /* lcount_regnum */ \ + -1, /* sar_regnum */ \ + -1, /* litbase_regnum */ \ + -1, /* interrupt_regnum */ \ + -1, /* interrupt2_regnum */ \ + -1, /* cpenable_regnum */ \ + -1, /* debugcause_regnum */ \ + -1, /* exccause_regnum */ \ + -1, /* excvaddr_regnum */ \ + 0, /* max_register_raw_size */ \ + 0, /* max_register_virtual_size */ \ + 0, /* fp_layout */ \ + 0, /* fp_layout_bytes */ \ + 0, /* gregmap */ \ + } #define XTENSA_CONFIG_INSTANTIATE(rmap,spill_size) \ struct gdbarch_tdep xtensa_tdep = \ XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spill_size);