Hi Steve,
On 7/6/2025 12:25 AM, Steve Kargl wrote:
On Sat, Jul 05, 2025 at 05:20:02PM +0800, Yuao Ma wrote:
diff --git a/libgfortran/configure b/libgfortran/configure
index 9898a94a372..971f1e9df5e 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -16413,7 +16413,7 @@ else
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))
What is the purpose of this change?
Since I don't have root/sudo permissions on my devbox, I manually
downloaded and compiled the autoconf 2.69 tarball. This means there
might be some minor discrepancies compared to the version shipped with
OS distributions.
I suspect the issue could be related to platforms where `off_t` is
32-bit, causing a left shift of 62 to result in undefined behavior. The
commit at
https://cgit.git.savannah.gnu.org/cgit/autoconf.git/commit/?id=a1d8293f3bfa2516f9a0424e3a6e63c2f8e93c6e
seems to support my theory.
Thanks,
Yuao