From patchwork Tue Jun 7 20:38:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 99326 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 094D2B6FE6 for ; Wed, 8 Jun 2011 06:39:18 +1000 (EST) Received: (qmail 18566 invoked by alias); 7 Jun 2011 20:39:16 -0000 Received: (qmail 18558 invoked by uid 22791); 7 Jun 2011 20:39:15 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 20:39:00 +0000 Received: from eggs.gnu.org ([140.186.70.92]:41648) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QU33D-00032W-1r for gcc-patches@gnu.org; Tue, 07 Jun 2011 16:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QU33A-0003X8-35 for gcc-patches@gnu.org; Tue, 07 Jun 2011 16:38:57 -0400 Received: from smtp171.iad.emailsrvr.com ([207.97.245.171]:39685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QU339-0003We-3O for gcc-patches@gnu.org; Tue, 07 Jun 2011 16:38:55 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp47.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id BE7913A9746 for ; Tue, 7 Jun 2011 16:38:53 -0400 (EDT) Received: by smtp47.relay.iad1a.emailsrvr.com (Authenticated sender: nicola.pero-AT-meta-innovation.com) with ESMTPSA id 4F7043A97EC for ; Tue, 7 Jun 2011 16:38:53 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: objc/objc++: fix most testsuite failures on darwin8 From: Nicola Pero In-Reply-To: <754C9AD7-0EC4-41CE-8C7D-D60F10702C57@meta-innovation.com> Date: Tue, 7 Jun 2011 21:38:52 +0100 Message-Id: <57A48117-16BE-48DE-BDAC-2BCB52926AA6@meta-innovation.com> References: <754C9AD7-0EC4-41CE-8C7D-D60F10702C57@meta-innovation.com> To: gcc-patches@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 207.97.245.171 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 This patch (written with Iain) fixes all the testsuite failiures on Darwin8. It includes the previous one. OK to commit ? Thanks Index: ChangeLog =================================================================== --- ChangeLog (revision 174760) +++ ChangeLog (working copy) @@ -1,3 +1,18 @@ +2011-06-07 Nicola Pero + Iain Sandoe + + * objc-obj-c++-shared/runtime.h (protocol_getMethodDescription): + Added code to deal with the case when [Protocol + -descriptionForInstanceMethod:] or [Protocol + -descriptionForClassMethod:] returns NULL. + +2011-06-07 Nicola Pero + Iain Sandoe + + * objc-obj-c++-shared/TestsuiteObject.h ([-free]): Return 'id'. + * objc-obj-c++-shared/TestsuiteObject.m ([-free]): Return 'id'. + Added cast. + 2011-06-07 Rainer Orth gcc/testsuite: Index: objc-obj-c++-shared/TestsuiteObject.h =================================================================== --- objc-obj-c++-shared/TestsuiteObject.h (revision 174761) +++ objc-obj-c++-shared/TestsuiteObject.h (working copy) @@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see + (id) new; + (id) alloc; - (id) init; -- (void) free; +- (id) free; /* Auxiliary methods. */ + (Class) class; Index: objc-obj-c++-shared/runtime.h =================================================================== --- objc-obj-c++-shared/runtime.h (revision 174761) +++ objc-obj-c++-shared/runtime.h (working copy) @@ -93,14 +93,16 @@ struct objc_method_description protocol_getMethodD struct objc_method_description result; if (instanceMethod) - { - tmp = [protocol descriptionForInstanceMethod: selector]; - result = *tmp; - } + tmp = [protocol descriptionForInstanceMethod: selector]; else + tmp = [protocol descriptionForClassMethod: selector]; + + if (tmp) + result = *tmp; + else { - tmp = [protocol descriptionForClassMethod: selector]; - result = *tmp; + result.name = (SEL)0; + result.types = (char *)0; } return result; Index: objc-obj-c++-shared/TestsuiteObject.m =================================================================== --- objc-obj-c++-shared/TestsuiteObject.m (revision 174761) +++ objc-obj-c++-shared/TestsuiteObject.m (working copy) @@ -41,9 +41,14 @@ along with GCC; see the file COPYING3. If not see { return self; } -- (void) free +/* We return 'id' to have the same signature as [Object -free] in + older runtimes and avoid warnings about conflicting signatures. */ +- (id) free { - object_dispose (self); + /* Cast 'self' to 'id' because the NeXT runtime in darwin8 (Apple + Mac OS X 10.4) declares object_dispose to take an "Object *" + argument. */ + return object_dispose ((id)self); } + (Class) class {