This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/80544 strip cv-quals from cast results
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan at acm dot org>
- Date: Thu, 25 May 2017 11:07:00 +0100
- Subject: Re: [PATCH] PR c++/80544 strip cv-quals from cast results
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E41182D9FC7
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E41182D9FC7
- References: <20170427165907.GL5109@redhat.com> <CADzB+2nMhFnDrqk1jbE3nDx7b1hukJuWB3J5pSt=dGXmceOVPA@mail.gmail.com> <20170523180046.GG12306@redhat.com> <CADzB+2=yocABQpVueGU4rTwLbTwn1f8wkT2FEUC4ZS0=Ai+oig@mail.gmail.com> <20170524142022.GJ12306@redhat.com> <m2inkp744p.fsf@linux-m68k.org>
On 25/05/17 10:05 +0200, Andreas Schwab wrote:
../../gcc/ada/gcc-interface/utils2.c: In function 'int compare_elmt_bitpos(const void*, const void*)':
../../gcc/ada/gcc-interface/utils2.c:1937:73: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
const constructor_elt * const elmt1 = (const constructor_elt * const) rt1;
^~~
../../gcc/ada/gcc-interface/utils2.c:1938:73: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
const constructor_elt * const elmt2 = (const constructor_elt * const) rt2;
I'm testing this obvious fix.
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index fc6f1b8..cd37791 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -1934,8 +1934,8 @@ build_call_raise_range (int msg, Node_Id gnat_node, char kind,
static int
compare_elmt_bitpos (const PTR rt1, const PTR rt2)
{
- const constructor_elt * const elmt1 = (const constructor_elt * const) rt1;
- const constructor_elt * const elmt2 = (const constructor_elt * const) rt2;
+ const constructor_elt * const elmt1 = (const constructor_elt *) rt1;
+ const constructor_elt * const elmt2 = (const constructor_elt *) rt2;
const_tree const field1 = elmt1->index;
const_tree const field2 = elmt2->index;
const int ret