Re: [PATCH] lib: avoid casting gint64 to time_t

Subject:Re: [PATCH] lib: avoid casting gint64 to time_t

Date:Wed, 24 Jun 2020 09:40:49 -0300


From:David Bremner

David Bremner <> writes:
>  This is not a complete fix, but at least the timestamp ends up
>  aparently correct in the database. It looks like there are still
>  wonky conversions on reading the large timestamp from the database.

There is another cast that is harder to avoid:

notmuch_message_get_date casts the output of
Xapian::sortable_unserialise to time_t.

Changing that would require an API/ABI change.

There are apparently still architectures where time_t is 32bits (it
seems like these machines with failing tests are among them). For 0.30 I
suspect the best thing is to mark the tests broken on architectures with
32 bit time_t. For the future I'm not sure, but maybe we should avoid
time_t completely.


notmuch mailing list