Subject: Re: Before I offically call this a time bug can someone else try this? (fwd)
To: None <tech-kern@netbsd.org>
From: ITOH Yasufumi <yasufu-i@is.aist-nara.ac.jp>
List: tech-kern
Date: 08/07/1998 16:24:56
In article <199808070031.UAA00817@lunacity.ne.mediaone.net>
mycroft@mit.edu writes:

> You're assuming twos-complement arithmetic and the `usual'
> implementation of promoting a negative number to unsigned.  ANSI C
> does *not* gaurantee that it will do what you expect.

The C standard does specify that converting a signed integer to unsigned
shall be done as if the representation were two's-complement.
(Reference: ISO/IEC 9899:1990 6.2.1.2 Signed and unsigned integers)

I can't find any restrictions to "time_t" type other than
that it shall be an arithmetic type (7.12.1) in the standard.
The standard also says that the encoding of the time_t is
unspecified (7.12.2.4).

Thus, I think there are no reason that the time_t shall not be
an unsigned integer *from the standard*.

Yes, there are plenty of reasons from the points of compatibility. :-)
--
ITOH, Yasufumi