From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24841 invoked by alias); 16 Apr 2012 14:40:35 -0000 Received: (qmail 24833 invoked by uid 22791); 16 Apr 2012 14:40:35 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_EG X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 14:40:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B8AB11C68D8; Mon, 16 Apr 2012 10:40:17 -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 kOlkkk4OKD4F; Mon, 16 Apr 2012 10:40:17 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 874EE1C6879; Mon, 16 Apr 2012 10:40:17 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E7E80145616; Mon, 16 Apr 2012 07:40:11 -0700 (PDT) Date: Mon, 16 Apr 2012 14:44:00 -0000 From: Joel Brobecker To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Ensure result of make_cleanup is never NULL. Message-ID: <20120416144011.GH2852@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00415.txt.bz2 > +/* 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) Just a tiny idea, not really important, but JIC: Could we use an enum intead of a define so that GDB prints "CLEANUP_FENCEPOST" rather than a numeric value when we print a cleanup pointer that's the fencepost? -- Joel