From: Paul Eggert Date: Sun, 17 Sep 2017 06:21:43 +0000 (-0700) Subject: manywarnings: port to GCC on 64-bit MS-Windows X-Git-Tag: v1.0~5917 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe;p=gnulib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 24d86f6c5c..6a0b496322 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-09-16 Paul Eggert + + 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 + 2017-09-13 Bruno Haible all: Replace many more http URLs by https URLs. Update stale URLs. 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 #include #include ]], [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"