From e5aab7e74931e4b4b0fd21abf4a6ea5b7f5134f4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 15 Mar 2011 14:56:37 -0700 Subject: [PATCH] * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST. * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this avoids undefined behavior in theory. --- src/ChangeLog | 4 ++++ src/alloc.c | 4 ++-- src/lisp.h | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index aa03ad660b7..d34e3478255 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-03-15 Paul Eggert + * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST. + * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this + avoids undefined behavior in theory. + * regex.c (IF_LINT): Add defn, for benefit of ../lib-src. Use functions, not macros, for up- and down-casing (Bug#8254). diff --git a/src/alloc.c b/src/alloc.c index d6b64de5af9..1ad8af0d61a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2653,17 +2653,17 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, return val; } +#ifdef GC_CHECK_CONS_LIST /* Get an error now if there's any junk in the cons free list. */ void check_cons_list (void) { -#ifdef GC_CHECK_CONS_LIST struct Lisp_Cons *tail = cons_free_list; while (tail) tail = tail->u.chain; -#endif } +#endif /* Make a list of 1, 2, 3, 4 or 5 specified objects. */ diff --git a/src/lisp.h b/src/lisp.h index ec45b83863b..79f3b2f980b 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -27,9 +27,10 @@ along with GNU Emacs. If not, see . */ types of run time checks for Lisp objects. */ #ifdef GC_CHECK_CONS_LIST -#define CHECK_CONS_LIST() check_cons_list() +extern void check_cons_list (void); +#define CHECK_CONS_LIST() check_cons_list () #else -#define CHECK_CONS_LIST() ((void)0) +#define CHECK_CONS_LIST() ((void) 0) #endif /* These are default choices for the types to use. */ -- 2.39.2