]> git.ipfire.org Git - thirdparty/make.git/commit
Support systems with 32-bit long and 64-bit time_t
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Oct 2022 21:24:53 +0000 (17:24 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 3 Oct 2022 19:11:57 +0000 (15:11 -0400)
commitae80eefe6559b21de6469ee7d48e418452ef3af7
treeb6d53d87fc5376cae3f93480fa910851dc5eff50
parent01142a53c9d99b9b72aedd37ffe5b8c75d795008
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.
bootstrap.conf
configure.ac
src/ar.c
src/arscan.c
src/file.c
src/makeint.h