File: avoid-undefined-behavior-for-32bit-off_t.patch

package info (click to toggle)
autoconf 2.72-5
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,808 kB
  • sloc: sh: 5,553; perl: 3,932; makefile: 123; lisp: 104
file content (27 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Fix undefined behavior for 32-bit off_t.
 autoconf (2.69-6) unstable; urgency=low
 .
   * lib/autoconf/specific.m4: Use ((off_t) 1 << 31) << 31 in place of
     (off_t) 1 << 62 to avoid undefined behavior when off_t is 32-bit.
     Closes: #742780.  Thanks to Mathieu Malaterre <malat@debian.org> for
     reporting this bug.
Author: Ben Pfaff <pfaffben@debian.org>
Bug-Debian: http://bugs.debian.org/742780
Forwarded: yes

---
Bug: #742780.
Bug-Debian: http://bugs.debian.org/742780
Last-Update: 2014-03-27

--- autoconf-2.69.orig/lib/autoconf/specific.m4
+++ autoconf-2.69/lib/autoconf/specific.m4
@@ -92,7 +92,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUD
     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