Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2003 05:12:12 -0600
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Terry Lambert <tlambert2@mindspring.com>, freebsd-arch@freebsd.org
Subject:   Re: __TIME_MIN/__TIME_MAX
Message-ID:  <20031116111212.GA55844@madman.celabo.org>
In-Reply-To: <20031116102010.GA53282@madman.celabo.org>
References:  <20031114194119.GA94198@madman.celabo.org> <3FB6AA8F.37ED6D50@mindspring.com> <20031116102010.GA53282@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 16, 2003 at 04:20:10AM -0600, Jacques A. Vidrine wrote:
>     /* How can this be implemented correctly? */
>     int range_error(long n, time_t t)
>     {
> 	    return (long)(t = n) == n;
>     }

Hrmp.  Because time_t is probably signed, technically this can cause
`undefined behavior' if the range of `long' is more than the range of
`time_t' (e.g. on alpha). *sigh*

All I really want to do is correct a parsing bug and at the same time
eliminate a warning so that I can set WARNS?=1 in libc before the code
freeze.

Cheers,
-- 
Jacques Vidrine   NTT/Verio SME      FreeBSD UNIX       Heimdal
nectar@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@kth.se



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