From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20937 invoked by alias); 7 Nov 2002 18:00:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20910 invoked from network); 7 Nov 2002 18:00:33 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 7 Nov 2002 18:00:33 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id gA7I0TI16756 for ; Thu, 7 Nov 2002 10:00:29 -0800 (PST) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Thu, 7 Nov 2002 10:00:13 -0800 Received: from apple.com (mrs.apple.com [17.201.24.155]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id gA7I0Sc26690; Thu, 7 Nov 2002 10:00:28 -0800 (PST) Date: Thu, 07 Nov 2002 10:00:00 -0000 Subject: Re: [basic-improvements] try/finally support for c/c++ - more tests Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v546) Cc: Fergus Henderson , Jakub Jelinek , Geoff Keating , Richard Henderson , "gcc-patches@gcc.gnu.org" , "jason@redhat.com" To: Aldy Hernandez From: Mike Stump In-Reply-To: <20021107165519.GC28497@redhat.com> Message-Id: <17252218-F27B-11D6-8292-000393941EE6@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00479.txt.bz2 On Thursday, November 7, 2002, at 08:55 AM, Aldy Hernandez wrote: >> But I would like the support for exception handling to include support >> for throwing and catching exceptions, not just try/finally. The >> current >> proposal seems too limited to be useful for much else than glibc, >> IMHO. > > How are you going to handle catching exceptions, given that we have no > way to recognize certain types in C (templates, classes, etc)? See > rth's post about catching exceptions in C. This is easy. You conform to the C++ rtti system. Another way to view that, is as the definition of the language independent runtime type information. Once you do that, you can catch and throw any C++ compatible type. There are many in gcc, for example, int. Another example: struct exception { int why; char *description; }; the possibilities are endless. The fact there might exist an example of a type that doesn't work in C land isn't that interesting. If we add the ability to throw and catch to C, we should of course just do it correctly, the first time.