This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Ensure result of make_cleanup is never NULL.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at sebabeach dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 16 Apr 2012 07:40:11 -0700
- Subject: Re: [RFA] Ensure result of make_cleanup is never NULL.
- References: <m3bomszayu.fsf@annie.sebabeach.org>
> +/* 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