This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH to display types when printing a conversion warning (PR c/81233)
- From: Marek Polacek <polacek at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>, David Malcolm <dmalcolm at redhat dot com>, Martin Sebor <msebor at redhat dot com>
- Date: Thu, 10 Aug 2017 10:58:15 +0200
- Subject: Re: C PATCH to display types when printing a conversion warning (PR c/81233)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=polacek at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C1D51C0546DC
- References: <20170713141820.GD2890@redhat.com> <mvmmv77ls7t.fsf@suse.de>
On Thu, Aug 10, 2017 at 10:52:54AM +0200, Andreas Schwab wrote:
> On Jul 13 2017, Marek Polacek <polacek@redhat.com> wrote:
>
> > diff --git gcc/testsuite/objc.dg/proto-lossage-4.m gcc/testsuite/objc.dg/proto-lossage-4.m
> > index e72328b3703..4c6b560bab4 100644
> > --- gcc/testsuite/objc.dg/proto-lossage-4.m
> > +++ gcc/testsuite/objc.dg/proto-lossage-4.m
> > @@ -28,13 +28,13 @@ long foo(void) {
> > receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .intptr_t." } */
> >
> > receiver += [(Obj *)receiver someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */
> > -/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> > +/* { dg-warning "assignment to 'intptr_t {aka long int}' from 'id' makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> >
> > receiver += [(Obj *)receiver anotherValue];
> > receiver += [(Obj <Proto> *)receiver someValue];
> > receiver += [(Obj <Proto> *)receiver anotherValue];
> > receiver += [objrcvr someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */
> > -/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> > +/* { dg-warning "assignment to 'intptr_t {aka long int}' from 'id' makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> >
> > receiver += [objrcvr anotherValue];
> > receiver += [(Obj <Proto> *)objrcvr someValue];
> > @@ -42,7 +42,7 @@ long foo(void) {
> > receiver += [objrcvr2 someValue];
> > receiver += [objrcvr2 anotherValue];
> > receiver += [(Obj *)objrcvr2 someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */
> > -/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> > +/* { dg-warning "assignment to 'intptr_t {aka long int}' from 'id' makes integer from pointer without a cast" "" { target *-*-* } .-1 } */
> >
> > receiver += [(Obj *)objrcvr2 anotherValue];
> >
>
> FAIL: objc.dg/proto-lossage-4.m -fgnu-runtime (test for warnings, line 30)
> FAIL: objc.dg/proto-lossage-4.m -fgnu-runtime (test for warnings, line 36)
> FAIL: objc.dg/proto-lossage-4.m -fgnu-runtime (test for warnings, line 44)
> FAIL: objc.dg/proto-lossage-4.m -fgnu-runtime (test for excess errors)
> Excess errors:
> /daten/aranym/gcc/gcc-20170810/gcc/testsuite/objc.dg/proto-lossage-4.m:30:12: warning: assignment to 'intptr_t {aka int}' from 'id' makes integer from pointer without a cast [-Wint-conversion]
> /daten/aranym/gcc/gcc-20170810/gcc/testsuite/objc.dg/proto-lossage-4.m:36:12: warning: assignment to 'intptr_t {aka int}' from 'id' makes integer from pointer without a cast [-Wint-conversion]
> /daten/aranym/gcc/gcc-20170810/gcc/testsuite/objc.dg/proto-lossage-4.m:44:12: warning: assignment to 'intptr_t {aka int}' from 'id' makes integer from pointer without a cast [-Wint-conversion]
Argh. Sorry, will fix now.
Marek