From patchwork Tue Oct 5 13:51:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 66831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2BA7AB70A7 for ; Wed, 6 Oct 2010 00:52:12 +1100 (EST) Received: (qmail 14855 invoked by alias); 5 Oct 2010 13:52:11 -0000 Received: (qmail 14841 invoked by uid 22791); 5 Oct 2010 13:52:10 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BJ X-Spam-Check-By: sourceware.org Received: from c2bthomr09.btconnect.com (HELO mail.btconnect.com) (213.123.20.127) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 13:52:03 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2bthomr09.btconnect.com with ESMTP id AEV30177; Tue, 05 Oct 2010 14:51:58 +0100 (BST) Cc: Mike Stump , Nicola Pero , GCC Patches Message-Id: <393F4EC2-A502-40ED-8730-6A1FF1BAB498@sandoe-acoustics.co.uk> From: IainS To: Kai Tietz In-Reply-To: Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [patch objc testsuite]: Fix testcase for scalar pointer type issue Date: Tue, 5 Oct 2010 14:51:57 +0100 References: X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4CAB2D7D.0302, actions=tag X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0207.4CAB2D81.009A, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=single engine X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi Kai, does the following work for you? (it is more within the guidelines given for use of the macros in say: http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros) Iain receiver += [(Obj *)receiver anotherValue]; receiver += [(Obj *)receiver someValue]; receiver += [(Obj *)receiver anotherValue]; receiver += [objrcvr someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */ -/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } 34 } */ +/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } 36 } */ receiver += [objrcvr anotherValue]; receiver += [(Obj *)objrcvr someValue]; @@ -40,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 *-*-* } 42 } */ +/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } 44 } */ receiver += [(Obj *)objrcvr2 anotherValue]; On 5 Oct 2010, at 14:16, Kai Tietz wrote: > Ping > > 2010/9/30 NightStrike : >> Ping >> >> On Wed, Sep 29, 2010 at 11:24 AM, Kai Tietz >> wrote: >>> Hello, >>> >>> This test didn't handled LLP64 case correctly. >>> >>> ChangeLog gcc/testsuite >>> >>> 2010-09-29 Kai Tietz >>> >>> * objc.dg/proto-lossage-4.m: Use __INTPTR_TYPE__ instead of >>> long type. >>> >>> Tested for x86_64-pc-mingw32, and i686-pc-cygwin. Ok for apply? >>> >>> >>> Regards, >>> i.A. Kai Tietz >>> >>> | (\_/) This is Bunny. Copy and paste Bunny >>> | (='.'=) into your signature to help him gain >>> | (")_(") world domination. >>> >>> >> > > > > -- > | (\_/) This is Bunny. Copy and paste > | (='.'=) Bunny into your signature to help > | (")_(") him gain world domination Index: gcc/testsuite/objc.dg/proto-lossage-4.m =================================================================== --- gcc/testsuite/objc.dg/proto-lossage-4.m (revision 164977) +++ gcc/testsuite/objc.dg/proto-lossage-4.m (working copy) @@ -3,36 +3,38 @@ /* Author: Ziemowit Laski . */ /* { dg-do compile } */ +#include + /* One-line substitute for objc/objc.h */ typedef struct objc_object { struct objc_class *class_pointer; } *id; @protocol Proto -- (long)someValue; +- (intptr_t)someValue; @end @interface Obj -- (long)anotherValue; +- (intptr_t)anotherValue; @end long foo(void) { - long receiver = 2; + intptr_t receiver = 2; Obj *objrcvr; Obj *objrcvr2; /* NB: Since 'receiver' is an invalid ObjC message receiver, the compiler should warn but then search for methods as if we were messaging 'id'. */ - receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .long int." } */ - receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .long int." } */ + receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .intptr_t." } */ + 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 *-*-* } 28 } */ +/* { dg-warning "assignment makes integer from pointer without a cast" "" { target *-*-* } 30 } */