From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16062 invoked by alias); 29 Jun 2007 16:17:48 -0000 Received: (qmail 16054 invoked by uid 22791); 29 Jun 2007 16:17:47 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Jun 2007 16:17:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B94802A9BED; Fri, 29 Jun 2007 12:17:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Gw74mA8DF6jR; Fri, 29 Jun 2007 12:17:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A2B712A9A61; Fri, 29 Jun 2007 12:17:43 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 29E64E7B54; Fri, 29 Jun 2007 12:19:50 -0400 (EDT) Date: Fri, 29 Jun 2007 17:02:00 -0000 From: Joel Brobecker To: msnyder@sonic.net, Michael Snyder , gdb-patches@sourceware.org Subject: Re: [OB] Add cleanup, source.c Message-ID: <20070629161950.GA3609@adacore.com> References: <9270.12.7.175.2.1183069663.squirrel@webmail.sonic.net> <20070628224815.GC12578@caradoc.them.org> <655C3D4066B7954481633935A40BB36F041427@ussunex02.svl.access-company.com> <20070628231153.GA14231@caradoc.them.org> <11470.12.7.175.2.1183080998.squirrel@webmail.sonic.net> <20070629113407.GA13561@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070629113407.GA13561@caradoc.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00527.txt.bz2 > >From gdbint.texinfo: > > Your function should explicitly do or discard the cleanups it > creates. Failing to do this leads to non-deterministic behavior since > the caller will arbitrarily do or discard your functions cleanups. > This need leads to two common cleanup styles. Humpf! I think I have contributed loads of patches that do not follow this advice. I'll be careful in the future, but sometimes it's not easy. For instance, when you have a function that has multiple possible exit points... -- Joel