]> code.delx.au - gnu-emacs/commitdiff
Do not assume EMACS_INT is the same width as a pointer.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 May 2011 07:13:19 +0000 (00:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 May 2011 07:13:19 +0000 (00:13 -0700)
This prepares for a future patch that will prefer 64-bit EMACS_INT if
available.  That patch can be tried now, by compiling with -DWIDE_EMACS_INT,
but it is temporarily not the default so that it can be further tested.

Also, install some other fixes for problems discovered by the static
checking of GCC 4.6.0.

Fixes: debbugs:8545 debbugs:8601 debbugs:8600 debbugs:8602
1  2 
ChangeLog
doc/lispref/ChangeLog
src/callproc.c
src/doc.c

diff --cc ChangeLog
index 83bbcf49d8ea25e14d504039b70b9186d4d91139,4e675fcca9ad3b5442d240e19524ad54ae075b3c..c7038691a32638f4a298e33cef2060f18ed8509b
+++ b/ChangeLog
@@@ -1,3 -1,15 +1,15 @@@
 -2011-05-05  Paul Eggert  <eggert@cs.ucla.edu>
++2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
+       Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
+       * Makefile.in (GNULIB_MODULES): Add stdarg, for va_copy.
+       * lib/stdarg.in.h, m4/stdarg.m4: New files, from gnulib.
+       * Makefile.in (GNULIB_TOOL_FLAG): Add --conditional-dependencies.
+       This new gnulib-tool option saves 'configure' the trouble of
+       checking for strtoull when strtoumax exists.
+       * configure.in (BITS_PER_LONG_LONG): New macro.
  2011-05-05  Glenn Morris  <rgm@gnu.org>
  
        * Makefile.in (bootstrap-clean): Save config.log.  (Bug#765)
index 4aa63c6abaadd28016d38da56a9e0ebd36b50c65,163de31f22098945759b3b15d8283b1919f37716..7ef3be46b68c980957d79208505957956241b39c
@@@ -1,3 -1,7 +1,7 @@@
 -2011-05-03  Paul Eggert  <eggert@cs.ucla.edu>
++2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
+       * numbers.texi (Integer Basics): Large integers are treated as floats.
  2011-04-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
        * processes.texi (Synchronous Processes): Document the (:file
diff --cc src/callproc.c
index 1d3d8764ff88d050f05c6469ebaa840ea7302d08,2763331bde2c74a69009b867497c1aca05f483f4..946670320cac605564e2750c4074e696ab369c43
@@@ -591,9 -589,20 +589,20 @@@ usage: (call-process PROGRAM &optional 
  
      BLOCK_INPUT;
  
-     pid = vfork ();
+     /* vfork, and prevent local vars from being clobbered by the vfork.  */
 -   {
++    {
+       int volatile fd_error_volatile = fd_error;
+       int volatile fd_output_volatile = fd_output;
+       int volatile output_to_buffer_volatile = output_to_buffer;
+       unsigned char const **volatile new_argv_volatile = new_argv;
+       pid = vfork ();
  
-     new_argv = new_argv_volatile;
+       fd_error = fd_error_volatile;
+       fd_output = fd_output_volatile;
+       output_to_buffer = output_to_buffer_volatile;
+       new_argv = new_argv_volatile;
+     }
  
      if (pid == 0)
        {
diff --cc src/doc.c
index 3832eb3708d6e31536f8bc6a3dfa63bae8e12f3d,d764b66e75e03389f413a828b1f072973b4d2d2b..89a7d322966079fe0029b55e4399d88f7d89b29a
+++ b/src/doc.c
@@@ -506,8 -506,11 +506,11 @@@ store_function_docstring (Lisp_Object f
    /* The type determines where the docstring is stored.  */
  
    /* Lisp_Subrs have a slot for it.  */
 -   if (SUBRP (fun))
 -     {
 -       intptr_t negative_offset = - offset;
 -       XSUBR (fun)->doc = (char *) negative_offset;
 -     }
 +  if (SUBRP (fun))
-     XSUBR (fun)->doc = (char *) - offset;
++    {
++      intptr_t negative_offset = - offset;
++      XSUBR (fun)->doc = (char *) negative_offset;
++    }
  
    /* If it's a lisp form, stick it in the form.  */
    else if (CONSP (fun))