Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2003 14:37:03 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        "Jacques A. Vidrine" <nectar@FreeBSD.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: __TIME_MIN/__TIME_MAX
Message-ID:  <3FB6AA8F.37ED6D50@mindspring.com>
References:  <20031114194119.GA94198@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
"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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FB6AA8F.37ED6D50>