summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-01 18:36:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-01 18:37:01 -0700
commit3707f609cb8017371610a5e2233bd8478416217c (patch)
treefc9ecf2d9754bf95cc33bd9319871d5ebd866fa1 /m4
parent13f4efb0fd5573255c694607552532788ba31c95 (diff)
Sync from gnulib
This incorporates: 2016-05-01 mktime: port to stricter signed overflow checking 2016-05-01 mktime: speed up DEBUG_MKTIME benchmarks 2016-05-01 mktime: resurrect DEBUG_MKTIME testing 2016-05-01 mktime: simplify DEBUG_MKTIME 2016-05-01 Port mktime_internal offset to unsigned time_t 2016-04-27 xstrtol: prohibit monstrosities like "1bB" 2016-04-13 mktime: improve integer overflow checking 2016-04-13 intprops: check two's complement assumption 2016-04-13 intprops, mktime, strtol: assume two's complement * lib/intprops.h, lib/mktime-internal.h, lib/mktime.c: * lib/strtol.c, lib/timegm.c, m4/mktime.m4, m4/std-gnu11.m4: Copy from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/mktime.m422
-rw-r--r--m4/std-gnu11.m48
2 files changed, 22 insertions, 8 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 78f16ba66a..5a0f2d88ab 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
-# serial 25
+# serial 26
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -7,9 +7,24 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Jim Meyering.
+AC_DEFUN([gl_TIME_T_IS_SIGNED],
+[
+ AC_CACHE_CHECK([whether time_t is signed],
+ [gl_cv_time_t_is_signed],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <time.h>
+ char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])],
+ [gl_cv_time_t_is_signed=yes],
+ [gl_cv_time_t_is_signed=no])])
+ if test $gl_cv_time_t_is_signed = yes; then
+ AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.])
+ fi
+])
+
AC_DEFUN([gl_FUNC_MKTIME],
[
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([gl_TIME_T_IS_SIGNED])
dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
dnl in Autoconf and because it invokes AC_LIBOBJ.
@@ -169,7 +184,6 @@ main ()
time_t t, delta;
int i, j;
int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
- int time_t_signed = ! ((time_t) 0 < (time_t) -1);
#if HAVE_DECL_ALARM
/* This test makes some buggy mktime implementations loop.
@@ -179,11 +193,11 @@ main ()
alarm (60);
#endif
- time_t_max = (! time_t_signed
+ time_t_max = (! TIME_T_IS_SIGNED
? (time_t) -1
: ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
* 2 + 1));
- time_t_min = (! time_t_signed
+ time_t_min = (! TIME_T_IS_SIGNED
? (time_t) 0
: time_t_signed_magnitude
? ~ (time_t) 0
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index e8d3ebcf2f..10da26f130 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -1,8 +1,8 @@
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
-# commit 739cdc82b5325402231f3f5e1a38f681fcbd1db2
-# dated Tue Mar 15 09:34:11 2016 -0700.
+# commit 017d5ddd82854911f0119691d91ea8a1438824d6
+# dated Sun Apr 3 13:57:17 2016 -0700
# This implementation will be obsolete once we can assume Autoconf 2.70
# or later is installed everywhere a Gnulib program might be developed.
@@ -707,7 +707,7 @@ AC_DEFUN([_AC_CXX_CXX11_TEST_BODY],
short sa[cxx11test::get_val()] = { 0 };
}
{
- // Test initialiser lists
+ // Test initializer lists
cxx11test::testinit il = { 4323, 435234.23544 };
}
{
@@ -801,7 +801,7 @@ dnl with extended modes being tried first.
# considers the compiler to be in ISO C++11 mode if it handles all the
# tests from the C++98 checks, plus the following: Language features
# (auto, constexpr, decltype, default/deleted constructors, delegate
-# constructors, final, initialiser lists, lambda functions, nullptr,
+# constructors, final, initializer lists, lambda functions, nullptr,
# override, range-based for loops, template brackets without spaces,
# unicode literals) and library features (array, memory (shared_ptr,
# weak_ptr), regex and tuple types).