From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16802 invoked by alias); 7 May 2003 02:32:04 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 16786 invoked from network); 7 May 2003 02:32:02 -0000 Received: from unknown (HELO doubledemon.codesourcery.com) (66.60.148.227) by sources.redhat.com with SMTP; 7 May 2003 02:32:02 -0000 Received: from doubledemon.codesourcery.com (doubledemon.codesourcery.com [127.0.0.1]) by doubledemon.codesourcery.com (8.12.8/8.12.8) with ESMTP id h472W19X002498; Tue, 6 May 2003 19:32:01 -0700 Subject: Re: __attribute__((cleanup(function)) versus try/finally From: Mark Mitchell To: Richard Henderson Cc: gcc@gcc.gnu.org In-Reply-To: <20030507001131.GI7564@redhat.com> References: <1052245742.2583.315.camel@doubledemon.codesourcery.com> <20030507001131.GI7564@redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 07 May 2003 02:32:00 -0000 Message-Id: <1052274721.2636.428.camel@doubledemon.codesourcery.com> Mime-Version: 1.0 X-SW-Source: 2003-05/txt/msg00574.txt.bz2 On Tue, 2003-05-06 at 17:11, Richard Henderson wrote: > On Tue, May 06, 2003 at 11:29:01AM -0700, Mark Mitchell wrote: > > I think RTH accepts the attribute solution as well. He would prefer > > try/finally, as I would prefer no extension, but I think we are both > > willing to accept the attribute. > > To some extent I kind-of like the attribute solution on its own. > It provides much more structured access to cleanups than the > arbitrary block of code that __finally allows. > > I'm not sure I want to explain to users that jumping out of the > __finally block (via goto/break/return) will lead to undefined > results. It's less difficult to explain that using longjmp out > of a function (under certain conditions) is undefined. > > > In fact, that solution delivers maximum performance: > > > > (1) C functions do not need to have handler code inserted. > > This is false. Handler code gets inserted with the attribute too. I wasn't talking about the attribute solution in this context. -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com