From owner-freebsd-arch Thu Jun 7 8:44:16 2001 Delivered-To: freebsd-arch@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 86E7537B406; Thu, 7 Jun 2001 08:44:09 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id LAA24831; Thu, 7 Jun 2001 11:44:08 -0400 (EDT) (envelope-from wollman) Date: Thu, 7 Jun 2001 11:44:08 -0400 (EDT) From: Garrett Wollman Message-Id: <200106071544.LAA24831@khavrinen.lcs.mit.edu> To: obrien@FreeBSD.org Cc: arch@FreeBSD.org, freebsd-standards@bostonradio.org Subject: Re: time_t definition is wrong In-Reply-To: <20010606184753.C45892@dragon.nuxi.com> References: <200106020823.f528N5O98998@earth.backplane.com> <20010602085237.A73968@dragon.nuxi.com> <200106021739.f52Hd9V03943@earth.backplane.com> <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> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: 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