From: Paul Eggert Date: Mon, 29 Jun 2020 23:51:08 +0000 (-0700) Subject: Fix undefined behavior in AC_SYS_LARGEFILE X-Git-Tag: v2.69b~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d8293f3bfa2516f9a0424e3a6e63c2f8e93c6e;p=thirdparty%2Fautoconf.git 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 --- 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