Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2001 11:44:08 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        obrien@FreeBSD.org
Cc:        arch@FreeBSD.org, freebsd-standards@bostonradio.org
Subject:   Re: time_t definition is wrong
Message-ID:  <200106071544.LAA24831@khavrinen.lcs.mit.edu>
In-Reply-To: <20010606184753.C45892@dragon.nuxi.com>
References:  <200106020823.f528N5O98998@earth.backplane.com> <20010602085237.A73968@dragon.nuxi.com> <200106021739.f52Hd9V03943@earth.backplane.com> <p05100e0fb73ee9d458f7@[128.113.24.47]> <20010602124907.G31257@dragon.nuxi.com> <200106022005.f52K5FR04823@earth.backplane.com> <20010602131404.M31257@dragon.nuxi.com> <200106022040.f52KeSJ05088@earth.backplane.com> <20010602142011.N31257@dragon.nuxi.com> <200106041547.LAA76688@khavrinen.lcs.mit.edu> <20010606184753.C45892@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Wed, 6 Jun 2001 18:47:53 -0700, "David O'Brien" <obrien@FreeBSD.org> said:

> With size_t you want to be able to hold the largest number you can.

No.  size_t is the *smallest* type which can hold the result of
`sizeof' on the largest addressable single object.  On an IP32/L64
architecture (e.g., GCC/i386 when configured in that mode), size_t
should be `unsigned int'.  On I32/P48/L64 (think i386 in segmented
protected mode) it would still be `unsigned int'.  There are specific
requirements for each of these types -- not all of which are spelled
out explicitly in the standards.  (In the Austin Group we were
actually able to pin down a couple of these types with a bit more
certainty by deducing properties of the type from what other parts of
the standards said one could do with it.)

As for time_t, I think `int' is a perfectly good definition, and has
the beneficial effect that code which takes erroneous shortcuts will
now generate warnings.  `long' is appropriate as well, and has some
POLA benefits.  `long long' would be very much inadvisable at this
time, and probably for several years to come, since C99 compilers are
just now starting to become available, and we still don't have a C99
Standard Library.

-GAWollman


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?200106071544.LAA24831>