]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix undefined behavior in AC_SYS_LARGEFILE
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Jun 2020 00:08:26 +0000 (17:08 -0700)
* 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

index 2809c00971b4040a53688e5b84b7bde6ec709880..f750722ac6d8a912071436080f88cec4fdfe580c 100644 (file)
@@ -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