From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18130 invoked by alias); 16 Apr 2012 10:52:39 -0000 Received: (qmail 18114 invoked by uid 22791); 16 Apr 2012 10:52:38 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 10:52:24 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GAqNBL008481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Apr 2012 06:52:24 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GAqM77008219; Mon, 16 Apr 2012 06:52:23 -0400 Message-ID: <4F8BF9E6.1020301@redhat.com> Date: Mon, 16 Apr 2012 10:58:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Doug Evans CC: gdb-patches@sourceware.org Subject: Re: [RFA] Ensure result of make_cleanup is never NULL. References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 2012-04/txt/msg00410.txt.bz2 This looks good to me. On 04/16/2012 03:06 AM, Doug Evans wrote: > +/* A fencepost used to mark the end of a cleanup chain. > + The value is chosen to be non-NULL so that make_cleanup never returns NULL, > + and cause a segv if dereferenced. */ > +#define CLEANUP_FENCEPOST ((struct cleanup *) 1) I'd mildly prefer -1. Easier to spot as being special with the debugger; as a general principle for these things, it's an address less likely to end be created by mistake (thinking of &foo->a yieling a pointer to a low address when foo is NULL); and it is just more customary. -- Pedro Alves