GNU bug report logs - #32902
Add support for (TIMESTAMP . RESOLUTION) Lisp timestamps

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Tue, 2 Oct 2018 01:02:02 UTC

Severity: wishlist

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 32902 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32902 <at> debbugs.gnu.org
Subject: Re: bug#32902: Add support for (TIMESTAMP . RESOLUTION) Lisp
 timestamps
Date: Sun, 7 Oct 2018 13:05:58 -0700
Eli Zaretskii wrote:
>    timefns.c: In function 'lisp_to_timespec':
>    timefns.c:899:21: warning: passing argument 2 of 'mpz_time' from incompatible pointer type [-Wincompatible-pointer-types]
>       if (mpz_time (*q, &result.tv_sec))
> 		       ^
>    timefns.c:828:1: note: expected 'time_t * {aka long int *}' but argument is of type '__time64_t * {aka long long int *}'
>     mpz_time (mpz_t const z, time_t *t)
>     ^~~~~~~~
> 
> I fixed it, but please take a look, perhaps there's a better fix for
> this situation.

That's only a very partial fix, unfortunately. I looked into the matter briefly, 
and was dismayed by how much work would be needed for a real fix, even if I 
fixed only timefns.c.

Wouldn't it be much better to remove the "#define _USE_32BIT_TIME_T" from 
nt/inc/mingw_time.h? That is what's causing the problem that your fix attempted 
to paper over. A lot of code assumes that a struct timespec (and struct 
timeval's) tv_sec component is of type time_t, and defining _USE_32BIT_TIME_T 
violates that assumption; furthermore it means that MinGW Emacs stops working in 
2038 (and doesn't work even now for timestamps more than 20 years into the 
future, something that is pretty routine for me and I imagine for other users).

Whatever backward-compatibility mess that defining _USE_32BIT_TIME_T attempts to 
work around, really needs to be worked around in a better way.




This bug report was last modified 6 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.