diff options
| author | Paul Eggert | 2014-06-01 16:58:38 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-06-01 16:58:38 -0700 |
| commit | eed652d649d28e9dafdb01f9c7425d7d28899e0d (patch) | |
| tree | 07fbdfd51e4877c85a23b996dc244ff7f21a0d57 | |
| parent | b9928bbace87a54feffa5fc21eab791f658406b9 (diff) | |
| download | emacs-eed652d649d28e9dafdb01f9c7425d7d28899e0d.tar.gz emacs-eed652d649d28e9dafdb01f9c7425d7d28899e0d.zip | |
Merge from gnulib.
This incorporates:
2014-06-02 acl: apply pure attribute to two functions
2014-06-01 gnulib-common.m4: add _GL_UNUSED_LABEL
2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1
2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1
* lib/acl-internal.h, lib/fcntl.in.h, lib/ftoastr.h:
* m4/dup2.m4, m4/fcntl.m4, m4/gnulib-common.m4:
Update from gnulib.
| -rw-r--r-- | ChangeLog | 11 | ||||
| -rw-r--r-- | lib/acl-internal.h | 4 | ||||
| -rw-r--r-- | lib/fcntl.in.h | 16 | ||||
| -rw-r--r-- | lib/ftoastr.h | 17 | ||||
| -rw-r--r-- | m4/dup2.m4 | 12 | ||||
| -rw-r--r-- | m4/fcntl.m4 | 12 | ||||
| -rw-r--r-- | m4/gnulib-common.m4 | 11 |
7 files changed, 69 insertions, 14 deletions
| @@ -1,3 +1,14 @@ | |||
| 1 | 2014-06-01 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Merge from gnulib, incorporating: | ||
| 4 | 2014-06-02 acl: apply pure attribute to two functions | ||
| 5 | 2014-06-01 gnulib-common.m4: add _GL_UNUSED_LABEL | ||
| 6 | 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 | ||
| 7 | 2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1 | ||
| 8 | * lib/acl-internal.h, lib/fcntl.in.h, lib/ftoastr.h: | ||
| 9 | * m4/dup2.m4, m4/fcntl.m4, m4/gnulib-common.m4: | ||
| 10 | Update from gnulib. | ||
| 11 | |||
| 1 | 2014-06-01 Juanma Barranquero <lekktu@gmail.com> | 12 | 2014-06-01 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 13 | ||
| 3 | * configure.ac (C_HEAP_SWITCH): Raise HEAPSIZE value for 32-bit | 14 | * configure.ac (C_HEAP_SWITCH): Raise HEAPSIZE value for 32-bit |
diff --git a/lib/acl-internal.h b/lib/acl-internal.h index fdffe648490..b2380068de7 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h | |||
| @@ -174,14 +174,14 @@ extern int acl_access_nontrivial (acl_t); | |||
| 174 | 174 | ||
| 175 | /* Return 1 if the given ACL is non-trivial. | 175 | /* Return 1 if the given ACL is non-trivial. |
| 176 | Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ | 176 | Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ |
| 177 | extern int acl_nontrivial (int count, aclent_t *entries); | 177 | extern int acl_nontrivial (int count, aclent_t *entries) _GL_ATTRIBUTE_PURE; |
| 178 | 178 | ||
| 179 | # ifdef ACE_GETACL /* Solaris 10 */ | 179 | # ifdef ACE_GETACL /* Solaris 10 */ |
| 180 | 180 | ||
| 181 | /* Test an ACL retrieved with ACE_GETACL. | 181 | /* Test an ACL retrieved with ACE_GETACL. |
| 182 | Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. | 182 | Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. |
| 183 | Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ | 183 | Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ |
| 184 | extern int acl_ace_nontrivial (int count, ace_t *entries); | 184 | extern int acl_ace_nontrivial (int count, ace_t *entries) _GL_ATTRIBUTE_PURE; |
| 185 | 185 | ||
| 186 | /* Definitions for when the built executable is executed on Solaris 10 | 186 | /* Definitions for when the built executable is executed on Solaris 10 |
| 187 | (newer version) or Solaris 11. */ | 187 | (newer version) or Solaris 11. */ |
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 99f75e60fd4..e23b4b2bcdd 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h | |||
| @@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " | |||
| 186 | 186 | ||
| 187 | /* Fix up the O_* macros. */ | 187 | /* Fix up the O_* macros. */ |
| 188 | 188 | ||
| 189 | /* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT | ||
| 190 | to values outside 'int' range, so omit these misdefinitions. | ||
| 191 | But avoid namespace pollution on non-AIX systems. */ | ||
| 192 | #ifdef _AIX | ||
| 193 | # include <limits.h> | ||
| 194 | # if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX) | ||
| 195 | # undef O_CLOEXEC | ||
| 196 | # endif | ||
| 197 | # if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) | ||
| 198 | # undef O_NOFOLLOW | ||
| 199 | # endif | ||
| 200 | # if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX) | ||
| 201 | # undef O_TTY_INIT | ||
| 202 | # endif | ||
| 203 | #endif | ||
| 204 | |||
| 189 | #if !defined O_DIRECT && defined O_DIRECTIO | 205 | #if !defined O_DIRECT && defined O_DIRECTIO |
| 190 | /* Tru64 spells it 'O_DIRECTIO'. */ | 206 | /* Tru64 spells it 'O_DIRECTIO'. */ |
| 191 | # define O_DIRECT O_DIRECTIO | 207 | # define O_DIRECT O_DIRECTIO |
diff --git a/lib/ftoastr.h b/lib/ftoastr.h index 6236292d9d9..26cad7369ce 100644 --- a/lib/ftoastr.h +++ b/lib/ftoastr.h | |||
| @@ -72,12 +72,13 @@ enum | |||
| 72 | 72 | ||
| 73 | /* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to | 73 | /* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to |
| 74 | represent a float value without losing information. Likewise for | 74 | represent a float value without losing information. Likewise for |
| 75 | _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double. */ | 75 | _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double. |
| 76 | These are macros, not enums, to work around a bug in IBM xlc 12.1. */ | ||
| 76 | 77 | ||
| 77 | #if FLT_RADIX == 10 /* decimal floating point */ | 78 | #if FLT_RADIX == 10 /* decimal floating point */ |
| 78 | enum { _GL_FLT_PREC_BOUND = FLT_MANT_DIG }; | 79 | # define _GL_FLT_PREC_BOUND FLT_MANT_DIG |
| 79 | enum { _GL_DBL_PREC_BOUND = DBL_MANT_DIG }; | 80 | # define _GL_DBL_PREC_BOUND DBL_MANT_DIG |
| 80 | enum { _GL_LDBL_PREC_BOUND = LDBL_MANT_DIG }; | 81 | # define _GL_LDBL_PREC_BOUND LDBL_MANT_DIG |
| 81 | #else | 82 | #else |
| 82 | 83 | ||
| 83 | /* An upper bound on the number of bits needed to represent a single | 84 | /* An upper bound on the number of bits needed to represent a single |
| @@ -95,13 +96,13 @@ enum | |||
| 95 | DIG digits. For why the "+ 1" is needed, see "Binary to Decimal | 96 | DIG digits. For why the "+ 1" is needed, see "Binary to Decimal |
| 96 | Conversion" in David Goldberg's paper "What Every Computer | 97 | Conversion" in David Goldberg's paper "What Every Computer |
| 97 | Scientist Should Know About Floating-Point Arithmetic" | 98 | Scientist Should Know About Floating-Point Arithmetic" |
| 98 | <http://docs.sun.com/source/806-3568/ncg_goldberg.html>. */ | 99 | <http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>. */ |
| 99 | # define _GL_FLOAT_PREC_BOUND(dig) \ | 100 | # define _GL_FLOAT_PREC_BOUND(dig) \ |
| 100 | (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1) | 101 | (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1) |
| 101 | 102 | ||
| 102 | enum { _GL_FLT_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) }; | 103 | # define _GL_FLT_PREC_BOUND _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) |
| 103 | enum { _GL_DBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) }; | 104 | # define _GL_DBL_PREC_BOUND _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) |
| 104 | enum { _GL_LDBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) }; | 105 | # define _GL_LDBL_PREC_BOUND _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) |
| 105 | #endif | 106 | #endif |
| 106 | 107 | ||
| 107 | 108 | ||
diff --git a/m4/dup2.m4 b/m4/dup2.m4 index 89638a0bfe3..6498fc20245 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 | |||
| @@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_DUP2], | |||
| 8 | [ | 8 | [ |
| 9 | AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) | 9 | AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) |
| 10 | AC_REQUIRE([AC_CANONICAL_HOST]) | 10 | AC_REQUIRE([AC_CANONICAL_HOST]) |
| 11 | AC_CHECK_FUNCS_ONCE([getdtablesize]) | ||
| 11 | m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ | 12 | m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ |
| 12 | AC_CHECK_FUNCS_ONCE([dup2]) | 13 | AC_CHECK_FUNCS_ONCE([dup2]) |
| 13 | if test $ac_cv_func_dup2 = no; then | 14 | if test $ac_cv_func_dup2 = no; then |
| @@ -23,6 +24,11 @@ AC_DEFUN([gl_FUNC_DUP2], | |||
| 23 | #include <fcntl.h> | 24 | #include <fcntl.h> |
| 24 | #include <errno.h>]], | 25 | #include <errno.h>]], |
| 25 | [int result = 0; | 26 | [int result = 0; |
| 27 | #ifdef HAVE_GETDTABLESIZE | ||
| 28 | int bad_fd = getdtablesize (); | ||
| 29 | #else | ||
| 30 | int bad_fd = 1000000; | ||
| 31 | #endif | ||
| 26 | #ifdef FD_CLOEXEC | 32 | #ifdef FD_CLOEXEC |
| 27 | if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) | 33 | if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) |
| 28 | result |= 1; | 34 | result |= 1; |
| @@ -37,7 +43,7 @@ AC_DEFUN([gl_FUNC_DUP2], | |||
| 37 | if (dup2 (0, 0) != -1) | 43 | if (dup2 (0, 0) != -1) |
| 38 | result |= 8; | 44 | result |= 8; |
| 39 | /* Many gnulib modules require POSIX conformance of EBADF. */ | 45 | /* Many gnulib modules require POSIX conformance of EBADF. */ |
| 40 | if (dup2 (2, 1000000) == -1 && errno != EBADF) | 46 | if (dup2 (2, bad_fd) == -1 && errno != EBADF) |
| 41 | result |= 16; | 47 | result |= 16; |
| 42 | /* Flush out some cygwin core dumps. */ | 48 | /* Flush out some cygwin core dumps. */ |
| 43 | if (dup2 (2, -1) != -1 || errno != EBADF) | 49 | if (dup2 (2, -1) != -1 || errno != EBADF) |
| @@ -56,7 +62,9 @@ AC_DEFUN([gl_FUNC_DUP2], | |||
| 56 | linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a | 62 | linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a |
| 57 | # closed fd may yield -EBADF instead of -1 / errno=EBADF. | 63 | # closed fd may yield -EBADF instead of -1 / errno=EBADF. |
| 58 | gl_cv_func_dup2_works="guessing no" ;; | 64 | gl_cv_func_dup2_works="guessing no" ;; |
| 59 | freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF. | 65 | aix* | freebsd*) |
| 66 | # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, | ||
| 67 | # not EBADF. | ||
| 60 | gl_cv_func_dup2_works="guessing no" ;; | 68 | gl_cv_func_dup2_works="guessing no" ;; |
| 61 | haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. | 69 | haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. |
| 62 | gl_cv_func_dup2_works="guessing no" ;; | 70 | gl_cv_func_dup2_works="guessing no" ;; |
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4 index 4a2771fae35..f824beb6597 100644 --- a/m4/fcntl.m4 +++ b/m4/fcntl.m4 | |||
| @@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_FCNTL], | |||
| 19 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 19 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 20 | AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) | 20 | AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) |
| 21 | AC_REQUIRE([AC_CANONICAL_HOST]) | 21 | AC_REQUIRE([AC_CANONICAL_HOST]) |
| 22 | AC_CHECK_FUNCS_ONCE([fcntl]) | 22 | AC_CHECK_FUNCS_ONCE([fcntl getdtablesize]) |
| 23 | if test $ac_cv_func_fcntl = no; then | 23 | if test $ac_cv_func_fcntl = no; then |
| 24 | gl_REPLACE_FCNTL | 24 | gl_REPLACE_FCNTL |
| 25 | else | 25 | else |
| @@ -28,11 +28,21 @@ AC_DEFUN([gl_FUNC_FCNTL], | |||
| 28 | AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], | 28 | AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], |
| 29 | [gl_cv_func_fcntl_f_dupfd_works], | 29 | [gl_cv_func_fcntl_f_dupfd_works], |
| 30 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | 30 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 31 | #ifdef HAVE_GETDTABLESIZE | ||
| 32 | # include <unistd.h> | ||
| 33 | #endif | ||
| 31 | #include <fcntl.h> | 34 | #include <fcntl.h> |
| 32 | #include <errno.h> | 35 | #include <errno.h> |
| 33 | ]], [[int result = 0; | 36 | ]], [[int result = 0; |
| 37 | #ifdef HAVE_GETDTABLESIZE | ||
| 38 | int bad_fd = getdtablesize (); | ||
| 39 | #else | ||
| 40 | int bad_fd = 1000000; | ||
| 41 | #endif | ||
| 34 | if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; | 42 | if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; |
| 35 | if (errno != EINVAL) result |= 2; | 43 | if (errno != EINVAL) result |= 2; |
| 44 | if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; | ||
| 45 | if (errno != EINVAL) result |= 8; | ||
| 36 | return result; | 46 | return result; |
| 37 | ]])], | 47 | ]])], |
| 38 | [gl_cv_func_fcntl_f_dupfd_works=yes], | 48 | [gl_cv_func_fcntl_f_dupfd_works=yes], |
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 20ce40e7441..1bb316bb157 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # gnulib-common.m4 serial 34 | 1 | # gnulib-common.m4 serial 35 |
| 2 | dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2007-2014 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -49,6 +49,15 @@ AC_DEFUN([gl_COMMON_BODY], [ | |||
| 49 | is a misnomer outside of parameter lists. */ | 49 | is a misnomer outside of parameter lists. */ |
| 50 | #define _UNUSED_PARAMETER_ _GL_UNUSED | 50 | #define _UNUSED_PARAMETER_ _GL_UNUSED |
| 51 | 51 | ||
| 52 | /* gcc supports the "unused" attribute on possibly unused labels, and | ||
| 53 | g++ has since version 4.5. */ | ||
| 54 | #if !defined __cplusplus || __GNUC__ > 4 \ | ||
| 55 | || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) | ||
| 56 | # define _GL_UNUSED_LABEL _GL_UNUSED | ||
| 57 | #else | ||
| 58 | # define _GL_UNUSED_LABEL | ||
| 59 | #endif | ||
| 60 | |||
| 52 | /* The __pure__ attribute was added in gcc 2.96. */ | 61 | /* The __pure__ attribute was added in gcc 2.96. */ |
| 53 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | 62 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
| 54 | # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) | 63 | # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |