From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15581 invoked by alias); 12 Mar 2002 18:34:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15489 invoked from network); 12 Mar 2002 18:34:16 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 12 Mar 2002 18:34:16 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 16A493E9F; Tue, 12 Mar 2002 13:34:13 -0500 (EST) Message-ID: <3C8E4A24.2090807@cygnus.com> Date: Tue, 12 Mar 2002 10:34:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: Klee Dienes Cc: Klee Dienes , Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: [RFA] Function return type checking References: <0A63ABF3-35E4-11D6-A901-0030653FA4C6@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-03/txt/msg00186.txt.bz2 > Saying that I "need" the infrastructure change for Objective-C would probably be a bit strong. > The basic issue arises when evaluating Objective-C expressions like the following: > > call [[window boundingBox] print] > > Here 'window' is of type NSWindow, an opaque type defined in a system library, and 'boundingBox' is a method of NSWindow that returns a NSRect. The issue arises because '[window boundingBox]' is really a function call to 'objc_msgSend_stret (window, selector)'. There generally isn't symbol information available for 'objc_msgSend_stret', but there often is for '[NSWindow boundingBox]'. So it's nice for Objective-C to be able to pass the correct return type information to 'call_function_by_hand' so that the result returns with the correct type, rather than have to cons up a fake function value with fake return type to pass to 'call_function_by_hand'. One of the things I've been puzzled by is how a user could get themselves in a situtation where the feature was needed. I was thinking that a well written program, having including all relevant headers, would have all the relevant information available. The above is starting to explain why there is a problem. Can you, humor me a little and express it in slightly more concret terms (bits of code). Does C++ have a similar problem? Keep in mind that Objective C doesn't have the same entrenched conventions that normal C suffers from - you've more freedom to define its behavour. > On Tuesday, March 12, 2002, at 07:55 AM, Andrew Cagney wrote: > > So there are two reasons for the change? The infrastructure you need for objective C and a user visible interface change. Can you expand a little on the objective C problems. If objective C has good reason for this infrastructure than I can't see why that part shouldn't go in. Andrew