From owner-freebsd-arch@FreeBSD.ORG Sat Nov 15 14:38:32 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FA0916A4CE; Sat, 15 Nov 2003 14:38:32 -0800 (PST) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55FF643FE5; Sat, 15 Nov 2003 14:38:31 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfj2j.dialup.mindspring.com ([165.247.204.83] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 1AL92t-0004Or-00; Sat, 15 Nov 2003 14:37:36 -0800 Message-ID: <3FB6AA8F.37ED6D50@mindspring.com> Date: Sat, 15 Nov 2003 14:37:03 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "Jacques A. Vidrine" References: <20031114194119.GA94198@madman.celabo.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4e92a567895908f40805ed6208cb31923387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c cc: freebsd-arch@freebsd.org Subject: Re: __TIME_MIN/__TIME_MAX X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 22:38:32 -0000 "Jacques A. Vidrine" wrote: > In at least one place in libc, it is necessary to range check a time_t > value. One most platforms, time_t has the same range as `int', but > on at least amd64, it has a larger range. Any objections to adding > definitions of __TIME_MIN and __TIME_MAX to sys/${arch}/_limits.h? > > I could just do the usual check for lossage after casting, except that > in theory time_t could be a floating-point value (but not in reality > in FreeBSD). It seems cleaner to me to have an explicit range. XSI: time_t and clock_t shall be integer or real-floating types. The range should be derived from th type. Defining separate values outside the implementation namespace might be OK, but keeping those values synchronized with the size_t is likely to be painful for years to come. -- Terry