unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* timestamp overflows sprinter interface
@ 2020-01-30  9:02 Peter Wang
  2020-02-03 13:40 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Wang @ 2020-01-30  9:02 UTC (permalink / raw)
  To: notmuch

Hi,

On a system where time_t is 64-bit and 'int' is a signed 32-bit integer
type, timestamps beyond some time in 2038 will be serialised to a
negative value.

The simplest solution appears to be to change the type in the sprinter
method to int64_t:

    void (*integer)(struct sprinter *, int64_t);

Any other suggestions?

Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: timestamp overflows sprinter interface
  2020-01-30  9:02 timestamp overflows sprinter interface Peter Wang
@ 2020-02-03 13:40 ` David Bremner
  2020-02-08  1:55   ` Peter Wang
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2020-02-03 13:40 UTC (permalink / raw)
  To: Peter Wang, notmuch

Peter Wang <novalazy@gmail.com> writes:

> Hi,
>
> On a system where time_t is 64-bit and 'int' is a signed 32-bit integer
> type, timestamps beyond some time in 2038 will be serialised to a
> negative value.

I admire your forward thinking!

>
> The simplest solution appears to be to change the type in the sprinter
> method to int64_t:
>
>     void (*integer)(struct sprinter *, int64_t);
>
> Any other suggestions?

Since this is an internal API, I don't really see a big problem with
doing this.

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: timestamp overflows sprinter interface
  2020-02-03 13:40 ` David Bremner
@ 2020-02-08  1:55   ` Peter Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Wang @ 2020-02-08  1:55 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

On Mon, 03 Feb 2020 09:40:49 -0400, David Bremner <david@tethera.net> wrote:
> Peter Wang <novalazy@gmail.com> writes:
> 
> > Hi,
> >
> > On a system where time_t is 64-bit and 'int' is a signed 32-bit integer
> > type, timestamps beyond some time in 2038 will be serialised to a
> > negative value.
> 
> I admire your forward thinking!

Nah, someone reported an issue with my mail client when viewing a
message dated 09 Dec 2058.

> 
> >
> > The simplest solution appears to be to change the type in the sprinter
> > method to int64_t:
> >
> >     void (*integer)(struct sprinter *, int64_t);
> >
> > Any other suggestions?
> 
> Since this is an internal API, I don't really see a big problem with
> doing this.

I've sent a patch.

Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-08  1:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30  9:02 timestamp overflows sprinter interface Peter Wang
2020-02-03 13:40 ` David Bremner
2020-02-08  1:55   ` Peter Wang

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).