From owner-freebsd-arch@FreeBSD.ORG Fri Nov 14 20:57:56 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 53E5616A4CE for ; Fri, 14 Nov 2003 20:57:56 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42E3743F3F for ; Fri, 14 Nov 2003 20:57:55 -0800 (PST) (envelope-from nectar@freebsd.org) Received: from localhost (localhost [127.0.0.1]) by gw.celabo.org (Postfix) with ESMTP id B0F01548A2; Fri, 14 Nov 2003 22:57:54 -0600 (CST) Received: from gw.celabo.org ([127.0.0.1]) by localhost (hellblazer.celabo.org [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 02859-01; Fri, 14 Nov 2003 22:57:44 -0600 (CST) Received: from lum.celabo.org (dhcp-204.celabo.org [10.0.1.204]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "lum.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id F162854883; Fri, 14 Nov 2003 22:57:43 -0600 (CST) Received: from freebsd.org (localhost [127.0.0.1]) by lum.celabo.org (Postfix) with ESMTP id 2FF53108FFE; Fri, 14 Nov 2003 22:58:01 -0600 (CST) Message-ID: <3FB5B258.6010207@freebsd.org> Date: Fri, 14 Nov 2003 22:58:00 -0600 From: Jacques Vidrine User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Evans References: <20031114194119.GA94198@madman.celabo.org> <20031115114906.L11453@gamplex.bde.org> In-Reply-To: <20031115114906.L11453@gamplex.bde.org> X-Enigmail-Version: 0.81.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 04:57:56 -0000 Bruce Evans said the following on 11/14/03 6:54 PM: > I prefer the cast. Actually, so do I :-) MIN/MAX values won't work for removing some (IMHO stupid) warnings emitted by GCC. So this kind of thing OK? long n; time_t t; errno = 0; n = strtoul(...); if (errno == ERANGE || (long)(t = n) != n) /* out of range */; > It doesn't require nonstandard infrastructure that > would need to be maintained forever, and works even better for floating > point too (assuming a C99 compiler, but not in reality in FreeBSD :) > (min/max checks don't work right for floating point because precision > may be just as important as range). Good points, thank you. Cheers, -- Jacques Vidrine NTT/Verio SME FreeBSD UNIX Heimdal nectar@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@kth.se