]> git.eshelyaron.com Git - emacs.git/commitdiff
* alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 21:56:37 +0000 (14:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 21:56:37 +0000 (14:56 -0700)
* lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
avoids undefined behavior in theory.

src/ChangeLog
src/alloc.c
src/lisp.h

index aa03ad660b7b417204b532bdc8a38858443e86cc..d34e3478255ad454b8cf16f6a983ed869f584379 100644 (file)
@@ -1,5 +1,9 @@
 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).
index d6b64de5af9821c63a92cf0cebc9d48c70c9cfcf..1ad8af0d61a782b51dfb5ffad5e0929e3e8d77ae 100644 (file)
@@ -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.  */
 
index ec45b83863b075c398411132c4849ac06800dd98..79f3b2f980b3f929ea1ae30101898de4073fb2c4 100644 (file)
@@ -27,9 +27,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    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.  */