From ae80eefe6559b21de6469ee7d48e418452ef3af7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 2 Oct 2022 17:24:53 -0400 Subject: Support systems with 32-bit long and 64-bit time_t Don't assume that time_t fits in long, as some hosts (e.g., glibc x86 -D_TIME_BITS=64) have 32-bit long and 64-bit time_t. * bootstrap.conf (gnulib_modules): Add largefile, to support files with timestamps after Y2038 on hosts with 32-bit long. * configure.ac: Do not call AC_SYS_LARGEFILE, as the largefile module does that for us. * src/makeint.h (PRIdMAX, PRIuMAX, SCNdMAX): Define if not already defined (taken from gnulib). * src/ar.c: Include intprops.h, for TYPE_MAXIMUM, as INTEGER_TYPE_MAXIMUM does not work on time_t without issuing a bunch of warnings. (ar_member_date): Check that result is in time_t range. (ar_member_date_1): Use intmax_t to hold the date. (ar_glob_match): Ditto. * src/arscan.c (VMS_function, VMS_function_ret, ar_scan) (parse_int, ar_scan, ar_member_pos, ar_member_touch) (describe_member): Convert long int to intmax_t. * src/file.c (file_timestamp_sprintf): Use intmax_t/uintmax_t instead of long/unsigned long for values that might be time_t. * src/arscan.c (ar_member_touch): Fix buffer overrun if the timestamp is too large. --- configure.ac | 5 ----- 1 file changed, 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ed747015..2f5d9810 100644 --- a/configure.ac +++ b/configure.ac @@ -57,11 +57,6 @@ AC_C_BIGENDIAN AM_GNU_GETTEXT_VERSION([0.19.4]) AM_GNU_GETTEXT([external]) -# This test must come as early as possible after the compiler configuration -# tests, because the choice of the file model can (in principle) affect -# whether functions and headers are available, whether they work, etc. -AC_SYS_LARGEFILE - # Checks for libraries. AC_SEARCH_LIBS([strerror],[cposix]) AC_SEARCH_LIBS([getpwnam], [sun]) -- cgit v1.2.1