From a1d8293f3bfa2516f9a0424e3a6e63c2f8e93c6e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Jun 2020 16:51:08 -0700 Subject: [PATCH] Fix undefined behavior in AC_SYS_LARGEFILE * lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES): Avoid undefined behavior on platforms where off_t is 32 bits. See: https://bugs.debian.org/742780 --- lib/autoconf/specific.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 2809c009..f750722a 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -93,7 +93,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl -- 2.47.2