diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-16 23:21:43 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-16 23:23:51 -0700 |
commit | e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe (patch) | |
tree | 2d636464cce0cf8a7c1c05ead938d4638928aac3 /m4 | |
parent | 25ca8d5facd519f3491833b133f23bf35773bed9 (diff) | |
download | gnulib-e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe.tar.gz |
manywarnings: port to GCC on 64-bit MS-Windows
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Work better if
LONG_MAX < PTRDIFF_MAX. Problem reported by Richard Copley in:
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00392.html
Diffstat (limited to 'm4')
-rw-r--r-- | m4/manywarnings.m4 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index eb89325519..604573ad48 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 12 +# manywarnings.m4 serial 13 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -267,18 +267,23 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)], # gcc --help=warnings outputs an unusual form for these options; list # them here so that the above 'comm' command doesn't report a false match. - # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal - # and AC_COMPUTE_INT requires it to fit in a long: + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal. + # Also, AC_COMPUTE_INT requirs it to fit in a long; it is 2**63 on + # the only platforms where it does not fit in a long, so make that + # a special case. AC_MSG_CHECKING([max safe object size]) AC_COMPUTE_INT([gl_alloc_max], - [(LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX) < (size_t) -1 - ? (LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX) - : (size_t) -1], + [LONG_MAX < (PTRDIFF_MAX < (size_t) -1 ? PTRDIFF_MAX : (size_t) -1) + ? -1 + : PTRDIFF_MAX < (size_t) -1 ? (long) PTRDIFF_MAX : (long) (size_t) -1], [[#include <limits.h> #include <stddef.h> #include <stdint.h> ]], [gl_alloc_max=2147483647]) + case $gl_alloc_max in + -1) gl_alloc_max=9223372036854775807;; + esac AC_MSG_RESULT([$gl_alloc_max]) gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max" gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" |