Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jun 2001 12:47:32 -0700
From:      "David O'Brien" <obrien@FreeBSD.ORG>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        David Wolfskill <david@catwhisker.org>, arch@FreeBSD.ORG
Subject:   Re: time_t definition is worng
Message-ID:  <20010602124732.F31257@dragon.nuxi.com>
In-Reply-To: <200106021739.f52Hd9V03943@earth.backplane.com>; from dillon@earth.backplane.com on Sat, Jun 02, 2001 at 10:39:09AM -0700
References:  <200106012318.f51NI8w38590@bunrab.catwhisker.org> <200106020823.f528N5O98998@earth.backplane.com> <20010602085237.A73968@dragon.nuxi.com> <200106021739.f52Hd9V03943@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 02, 2001 at 10:39:09AM -0700, Matt Dillon wrote:
>     Consistency is best, but breaking IA32 to match the already broken
>     Alpha port is the wrong solution.  For consistency we should match

Why is the Alpha port broken?  time_t is 32-bits without question.  Thus
it must be an `int' on Alpha, IA-64, and sparc64.


>     what Solaris, Linux, and most other UNIX operating systems use, which
>     is 'long'.  Our Alpha port is improperly using an int for time_t where
>     nearly every other 64 bit cpu port uses a (64 bit) long.

I 100% disagree -- we should be consistent with FreeBSD and that matters
more than other non-FreeBSD OS's.  To get the same wrap around
characteristics on our 64-bit platforms as our 32-bit ones, time_t must
be an `int' on 64-bit platforms.

BTW, NetBSD Alpha and sparc64 (ie, all their 64-bit platforms) have
_BSD_TIME_T_ as `int'.  HP-UX 11 defines it as `int32_t' so it is
consistent across their 32-bit and 64-bit machines.


>     but we should absolutely not break the IA32 port because of that.
>     The IA32 port had it correct when it was 'long', allowing software
>     to be written in a portable manner between platforms and OSs
>     (except for our broken Alpha port) without any aches or pains.

Why do you consider time_t == `int' on i386 broken?  Just because of the
printf() format string?

> Certain core types like time_t
>     have serious limitations when declared as a fixed width type (int 
>     nowadays).  long is the perfect solution and you just blew that all to
>     hell with this commit.

I am more than willing to define time_t as `long long' so it is 64-bits
across the board.
 
-- 
-- David  (obrien@FreeBSD.org)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010602124732.F31257>