lkml.org 
[lkml]   [2000]   [Jan]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 06 Jan 2000 17:17:55 +1030
FromGlen Turner <>
SubjectRe: time_t size: The year 2038 bug?
> > ANSI/ISO C defines time_t as a signed arithmetic type, so
> > such a change would break correct code.
> 
>         Are you positive? 

I checked and you are right.  ANSI C just requires that it
be an arithmetic type [7.12.1] (and by other rules in the
document, a *standard* arithmetic type).

I'd look in the POSIX standard, but someone has borrowed
my copy and I've just noticed that it's not on-line [1].

I'd expect POSIX to at least constrain time_t's base type to
an integer type.

Note that an unsigned time_t would break a lot of code: all
UNIXen I know of will accept a mktime() with a date prior
to the start of the epoch.  Given that lots of people have
birth dates prior to the start of the epoch, calling mktime()
with such a value isn't unreasonable.

This strictly doesn't matter for the kernel, except that
implementing differing time types between the kernel and
C library causes surprises, and thus bugs.

Regards,
glen

 [1] This *really* annoys me.  Standards are built from
     contributed and volunteer labour.

-- 
 Glen Turner                                 Network Engineer
 (08) 8303 3936      Australian Academic and Research Network
 glen.turner@aarnet.edu.au          http://www.aarnet.edu.au/
--
 Earth is a single point of failure

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2008