* alloc.c (die): Move "assertion failed" string here ...
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 20 Jun 2013 14:47:46 +0000 (07:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 20 Jun 2013 14:47:46 +0000 (07:47 -0700)
* lisp.h (eassert): ... from here.  Also, suppress evaluation of
COND when SUPPRESS_CHECKING.  This shrinks the executable text
size by 0.8% to 2.2% when configured with --enable-checking,
depending on optimization flags (GCC 4.8.1 x86-64).

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

index c503da2..82856eb 100644 (file)
@@ -1,5 +1,11 @@
 2013-06-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * alloc.c (die): Move "assertion failed" string here ...
+       * lisp.h (eassert): ... from here.  Also, suppress evaluation of
+       COND when SUPPRESS_CHECKING.  This shrinks the executable text
+       size by 0.8% to 2.2% when configured with --enable-checking,
+       depending on optimization flags (GCC 4.8.1 x86-64).
+
        * floatfns.c (Flog10): Move to Lisp (marked obsolete there).
 
 2013-06-20  RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
index 3eb7e98..d277dd2 100644 (file)
@@ -6515,7 +6515,7 @@ bool suppress_checking;
 void
 die (const char *msg, const char *file, int line)
 {
-  fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
+  fprintf (stderr, "\r\n%s:%d: Emacs fatal error: assertion failed: %s\r\n",
           file, line, msg);
   terminate_due_to_signal (SIGABRT, INT_MAX);
 }
index 3a4819c..e2d091e 100644 (file)
@@ -130,9 +130,9 @@ extern _Noreturn void die (const char *, const char *, int);
 extern bool suppress_checking EXTERNALLY_VISIBLE;
 
 # define eassert(cond)                                         \
-   ((cond) || suppress_checking                                        \
+   (suppress_checking || (cond)                                \
     ? (void) 0                                                 \
-    : die ("assertion failed: " # cond, __FILE__, __LINE__))
+    : die (# cond, __FILE__, __LINE__))
 #endif /* ENABLE_CHECKING */
 \f
 /* Use the configure flag --enable-check-lisp-object-type to make