Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@sebabeach.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Ensure result of make_cleanup is never NULL.
Date: Mon, 16 Apr 2012 10:58:00 -0000	[thread overview]
Message-ID: <4F8BF9E6.1020301@redhat.com> (raw)
In-Reply-To: <m3bomszayu.fsf@annie.sebabeach.org>

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


  reply	other threads:[~2012-04-16 10:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16  5:01 Doug Evans
2012-04-16 10:58 ` Pedro Alves [this message]
2012-04-16 14:44 ` Joel Brobecker
2012-04-16 14:58   ` Jan Kratochvil
2012-04-16 15:03   ` Pedro Alves
2012-04-16 20:16     ` Tom Tromey
     [not found]     ` <CADPb22SfUk5s9JSSBvUTWVyhoiEqO4Gi+VNO-9MwH6rqW8qQ3g@mail.gmail.com>
2012-04-17 23:12       ` Doug Evans
2012-04-18  1:06         ` Doug Evans
2012-04-18  1:58           ` Joel Brobecker
2012-04-18  9:21             ` Pedro Alves
2012-04-18  9:29           ` Pedro Alves
2012-04-18 14:14             ` Doug Evans
2012-04-18 14:25               ` Pedro Alves
2012-04-18 14:32                 ` Doug Evans
2012-04-18 14:36                   ` Pedro Alves
2012-04-18 14:38                 ` Tom Tromey
2012-04-19 19:24                   ` Doug Evans
2012-04-18  9:26         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8BF9E6.1020301@redhat.com \
    --to=palves@redhat.com \
    --cc=dje@sebabeach.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox