On Wed, Apr 18, 2012 at 7:36 AM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Well, aren't all places using the sentinel, using it throught the macro? > Pedro> What does this make more robust? > > If you initialize the object it can end up in a read-only section, so > writes to it will SEGV. > > In this particular case I don't see that this would help a lot, since > the object is just a sentinel.  But, it wouldn't hurt and maybe it would > catch some really unusual bug. Hi. fyi, here is what I committed. I changed the name cleanup_sentinel -> sentinel_cleanup because I went to print the value in gdb and spelled it the latter way and when that failed I cursed because I was darn sure I had spelled it correctly. That told me I liked the latter spelling better. :-) Anyways ... 2012-04-19 Doug Evans * cleanups.h (struct cleanup): Move to cleanups.c. (make_cleanup_dtor_ftype): New typedef. (make_cleanup_dtor): Use it. (ALL_CLEANUPS): Replace with ... (all_cleanups): ... this. Declare. All uses updated. * cleanups.c: #include "gdb_assert.h". (sentinel_cleanup): New static global. (SENTINEL_CLEANUP): Define. (cleanup_chain, final_cleanup_chain): Initialize to SENTINEL_CLEANUP. (make_my_cleanup2): Assert result is non-NULL. (all_cleanups): New function. (save_my_cleanups): Initialize new chain to SENTINEL_CLEANUP instead of NULL.