From b8748dd0932cbcf44bcbde8591f5cebad7eebfb1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 4 Aug 2017 22:46:31 -0700 Subject: [PATCH] Merge from gnulib This incorporates: 2017-08-04 manywarnings: port to 64-bit GCC builds of Emacs 2017-08-01 manywarnings: port to 32-bit GCC bug * lib/gnulib.mk.in: Regenerate. * m4/manywarnings.m4: Copy from gnulib. --- lib/gnulib.mk.in | 2 -- m4/manywarnings.m4 | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 11c1ecf05ad..a385c8c8384 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -546,8 +546,6 @@ LD_SWITCH_SYSTEM_TEMACS = @LD_SWITCH_SYSTEM_TEMACS@ LD_SWITCH_X_SITE = @LD_SWITCH_X_SITE@ LD_SWITCH_X_SITE_RPATH = @LD_SWITCH_X_SITE_RPATH@ LIBGIF = @LIBGIF@ -LIBGNUTLS3_CFLAGS = @LIBGNUTLS3_CFLAGS@ -LIBGNUTLS3_LIBS = @LIBGNUTLS3_LIBS@ LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 2d35eff6a2c..6a8939b2c1e 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 8 +# manywarnings.m4 serial 10 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, @@ -258,9 +258,20 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], # 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: - ptrdiff_max_max=9223372036854775807 - gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" + # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal + # and AC_COMPUTE_INT requires it to fit in a long: + 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], + [[#include + #include + #include + ]], + [gl_alloc_max=2147483647]) + 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" gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" -- 2.39.2