emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117174: Fix port to 32-bit AIX with xlc.


From: Paul Eggert
Subject: [Emacs-diffs] emacs-24 r117174: Fix port to 32-bit AIX with xlc.
Date: Fri, 30 May 2014 20:19:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117174
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17598
committer: Paul Eggert <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-05-30 13:19:29 -0700
message:
  Fix port to 32-bit AIX with xlc.
  
  This doesn't fix Bug#17598, but it does fix a regression since Emacs
  built with xlc until recently, and perhaps it'll help us fix Bug#17598.
  * configure.ac (GC_SETJMP_WORKS): Define for AIX, too.
  Merge from gnulib, incorporating:
  2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1
  * lib/ftoastr.c: Update from gnulib.
  * src/alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE.
  * src/conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty.
  * src/lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum,
  to work around a compiler bug in IBM xlc 12.1.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
  lib/ftoastr.h                  ftoastr.h-20110109011256-9ivo9ejnuk22w2iy-3
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/alloc.c                    alloc.c-20091113204419-o5vbwnq5f7feedwu-252
  src/conf_post.h                conf_post.h-20120730211826-q0qbxxwh2emw52hd-1
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-05-22 05:00:39 +0000
+++ b/ChangeLog 2014-05-30 20:19:29 +0000
@@ -1,3 +1,13 @@
+2014-05-30  Paul Eggert  <address@hidden>
+
+       Fix port to 32-bit AIX with xlc (Bug#17598).
+       This doesn't fix Bug#17598, but it does fix a regression since Emacs
+       built with xlc until recently, and perhaps it'll help us fix Bug#17598.
+       * configure.ac (GC_SETJMP_WORKS): Define for AIX, too.
+       Merge from gnulib, incorporating:
+       2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1
+       * lib/ftoastr.c: Update from gnulib.
+
 2014-05-22  Paul Eggert  <address@hidden>
 
        Fix port to 32-bit AIX (Bug#17540).

=== modified file 'configure.ac'
--- a/configure.ac      2014-05-22 05:00:39 +0000
+++ b/configure.ac      2014-05-30 20:19:29 +0000
@@ -4380,7 +4380,7 @@
 else
   case $opsys in
     dnl irix: Tested on Irix 6.5.  SCM worked on earlier versions.
-    dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* )
+    aix* | dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* )
       AC_DEFINE(GC_SETJMP_WORKS, 1)
       ;;
   esac

=== modified file 'lib/ftoastr.h'
--- a/lib/ftoastr.h     2014-01-01 07:43:34 +0000
+++ b/lib/ftoastr.h     2014-05-30 20:19:29 +0000
@@ -72,12 +72,13 @@
 
 /* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to
    represent a float value without losing information.  Likewise for
-   _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double.  */
+   _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double.
+   These are macros, not enums, to work around a bug in IBM xlc 12.1.  */
 
 #if FLT_RADIX == 10 /* decimal floating point */
- enum {  _GL_FLT_PREC_BOUND =  FLT_MANT_DIG };
- enum {  _GL_DBL_PREC_BOUND =  DBL_MANT_DIG };
- enum { _GL_LDBL_PREC_BOUND = LDBL_MANT_DIG };
+# define  _GL_FLT_PREC_BOUND  FLT_MANT_DIG
+# define  _GL_DBL_PREC_BOUND  DBL_MANT_DIG
+# define _GL_LDBL_PREC_BOUND LDBL_MANT_DIG
 #else
 
 /* An upper bound on the number of bits needed to represent a single
@@ -95,13 +96,13 @@
    DIG digits.  For why the "+ 1" is needed, see "Binary to Decimal
    Conversion" in David Goldberg's paper "What Every Computer
    Scientist Should Know About Floating-Point Arithmetic"
-   <http://docs.sun.com/source/806-3568/ncg_goldberg.html>.  */
+   <http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>.  */
 # define _GL_FLOAT_PREC_BOUND(dig) \
    (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1)
 
- enum {  _GL_FLT_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) };
- enum {  _GL_DBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) };
- enum { _GL_LDBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) };
+# define  _GL_FLT_PREC_BOUND _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG)
+# define  _GL_DBL_PREC_BOUND _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG)
+# define _GL_LDBL_PREC_BOUND _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG)
 #endif
 
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-05-29 16:47:49 +0000
+++ b/src/ChangeLog     2014-05-30 20:19:29 +0000
@@ -1,3 +1,11 @@
+2014-05-30  Paul Eggert  <address@hidden>
+
+       Fix port to 32-bit AIX with xlc (Bug#17598).
+       * alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE.
+       * conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty.
+       * lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum,
+       to work around a compiler bug in IBM xlc 12.1.
+
 2014-05-29  Eli Zaretskii  <address@hidden>
 
        * xterm.c (x_update_window_end): Don't invalidate the entire

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2014-04-13 22:51:08 +0000
+++ b/src/alloc.c       2014-05-30 20:19:29 +0000
@@ -7003,7 +7003,6 @@
   enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
   enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE;
   enum enum_USE_LSB_TAG enum_USE_LSB_TAG;
-  enum FLOAT_TO_STRING_BUFSIZE FLOAT_TO_STRING_BUFSIZE;
   enum Lisp_Bits Lisp_Bits;
   enum Lisp_Compiled Lisp_Compiled;
   enum maxargs maxargs;

=== modified file 'src/conf_post.h'
--- a/src/conf_post.h   2014-04-21 00:31:59 +0000
+++ b/src/conf_post.h   2014-05-30 20:19:29 +0000
@@ -297,8 +297,9 @@
 
 /* To use the struct hack with N elements, declare the struct like this:
      struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; };
-   and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes.  */
-#if 199901 <= __STDC_VERSION__
+   and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes.
+   IBM xlc 12.1 claims to do C99 but mishandles flexible array members.  */
+#if 199901 <= __STDC_VERSION__ && !defined __IBMC__
 # define FLEXIBLE_ARRAY_MEMBER
 #elif __GNUC__ && !defined __STRICT_ANSI__
 # define FLEXIBLE_ARRAY_MEMBER 0

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2014-05-29 05:31:43 +0000
+++ b/src/lisp.h        2014-05-30 20:19:29 +0000
@@ -3815,7 +3815,7 @@
                                 Lisp_Object);
 extern Lisp_Object internal_with_output_to_temp_buffer
         (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object);
-enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 };
+#define FLOAT_TO_STRING_BUFSIZE 350
 extern int float_to_string (char *, double);
 extern void init_print_once (void);
 extern void syms_of_print (void);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]