2011-03-15 Paul Eggert <eggert@cs.ucla.edu>
+ * 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).
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. */
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. */