]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp.h (eassert): Check that the argument compiles, even if
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 23:14:54 +0000 (16:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 23:14:54 +0000 (16:14 -0700)
ENABLE_CHECKING is not defined.

src/ChangeLog
src/lisp.h

index 261805a8484d4134058713d5c2147151c0acc78e..ad96221ed107868d1c8e56bd71416cfc52088c64 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * lisp.h (eassert): Check that the argument compiles, even if
+       ENABLE_CHECKING is not defined.
+
        * data.c (Findirect_variable): Name an expression, to avoid
        gcc -Wbad-function-cast warning.
        (default_value, arithcompare, arith_driver, arith_error): Now static.
index 79f3b2f980b3f929ea1ae30101898de4073fb2c4..5da73c57c66b6fa49d9953ea90876cd1947d4134 100644 (file)
@@ -86,7 +86,7 @@ extern void die (const char *, const char *, int) NO_RETURN;
 /* Define an Emacs version of "assert", since some system ones are
    flaky.  */
 #ifndef ENABLE_CHECKING
-#define eassert(X)     (void) 0
+#define eassert(X) ((void) (0 && (X))) /* Check that X compiles.  */
 #else /* ENABLE_CHECKING */
 #if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__)
 #define eassert(cond) CHECK(cond,"assertion failed: " #cond)