This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH to display types when printing a conversion warning (PR c/81233)


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]