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: Andreas Schwab <schwab at suse dot de>
- To: Marek Polacek <polacek at redhat dot com>
- 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:52:54 +0200
- Subject: Re: C PATCH to display types when printing a conversion warning (PR c/81233)
- Authentication-results: sourceware.org; auth=none
- References: <20170713141820.GD2890@redhat.com>
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]
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."