On Wed, Jan 05, 2005 at 09:32:16PM +0200, Moish wrote: > Quoting the ever-optimistic www.2038bug.com: > > #include <stdlib.h> > #include <stdio.h> > #include <time.h> > > int main (int argc, char **argv) > { > time_t t; > t = (time_t) 1000000000; > printf ("%d, %s", (int) t, asctime (gmtime (&t))); > t = (time_t) (0x7FFFFFFF); > printf ("%d, %s", (int) t, asctime (gmtime (&t))); > t++; > printf ("%d, %s", (int) t, asctime (gmtime (&t))); > return 0; > }
Oh, the "2^31 seconds are enough time for everybody", brought to you by one or more careless UNIX designers who might be lucky enough to be alive and 100+ years old when this bug actually manifests. In GNU/Linux, time_t is typedef'ed from __time_t, that is typedef'ed from __TIME_T, that in turn typedef'ed from __SLONGWORD_TYPE, that is defined from 'long int'. Even today 64 bit architectures define 'long int' as 64 bit on some cases. Hopefully most 32-bit architectures will perish until 2038. Nowadays, AMD64 slowly becomes commodoty hardware, so I'm optimistic. -- Dan Aloni [EMAIL PROTECTED] ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]