]> code.delx.au - gnu-emacs/commitdiff
* lisp.h (TAG_SYMPTR): Don't do arithmetic on NULL.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jan 2015 07:39:56 +0000 (23:39 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jan 2015 07:40:20 +0000 (23:40 -0800)
This is a followup to the "Port Qnil==0 XUNTAG to clang" patch.
Although clang doesn't need it, some other compiler might, and
it's easy enough to be safe.

src/ChangeLog
src/lisp.h

index 7a98555cc9cdcdebb0b3a873da863f24b578212c..33030cb86604343c2bd0ed1dfeb9398d5ce89131 100644 (file)
@@ -1,5 +1,10 @@
 2015-01-08  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * lisp.h (TAG_SYMPTR): Don't do arithmetic on NULL.
+       This is a followup to the "Port Qnil==0 XUNTAG to clang" patch.
+       Although clang doesn't need it, some other compiler might, and
+       it's easy enough to be safe.
+
        * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.
        Apparently clang removed support for the alloc_size attribute.
 
index b9263f88c119357eb77a15963e16b25cb2a516c6..97abaade1e145a0897ea725f7562669fb2f30703 100644 (file)
@@ -729,7 +729,8 @@ struct Lisp_Symbol
 
 /* Yield an integer that tags PTR as a symbol.  */
 #define TAG_SYMPTR(ptr) \
-  TAG_PTR (Lisp_Symbol, (char *) (ptr) - (char *) (USE_LSB_TAG ? lispsym : 0))
+  TAG_PTR (Lisp_Symbol, \
+          USE_LSB_TAG ? (char *) (ptr) - (char *) lispsym : (intptr_t) (ptr))
 
 /* Declare extern constants for Lisp symbols.  These can be helpful
    when using a debugger like GDB, on older platforms where the debug