From owner-cvs-all Tue Oct 30 8: 5:59 2001 Delivered-To: cvs-all@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 7FF7A37B401; Tue, 30 Oct 2001 08:05:50 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.4) id f9UG5l925501; Tue, 30 Oct 2001 11:05:47 -0500 (EST) (envelope-from wollman) Date: Tue, 30 Oct 2001 11:05:47 -0500 (EST) From: Garrett Wollman Message-Id: <200110301605.f9UG5l925501@khavrinen.lcs.mit.edu> To: Peter Pentchev Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/dump optr.c In-Reply-To: <20011030110300.B622@straylight.oblivion.bg> References: <200110280613.f9S6Dlc96209@freefall.freebsd.org> <20011030110300.B622@straylight.oblivion.bg> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > How about the following change? I don't think it's really correct either, > technically deltat should be declared 'double' and the division by 3600 > should be rewritten; still, isn't difftime(3) the correct way to, well, > to diff times? :) To compute the difference between two arbitrary time_t values in a way which is portable to all Standard C implementations, difftime() should be used. HOWEVER, `dump' is manifestly not a strictly conforming Standard C program; it doesn't even make sense for it to be one. Thus, it is acceptable for `dump' to depend on the POSIX definition of time_t as measuring times in nominal seconds. A strictly conforming POSIX program should not assume that time_t is an integral type; it might be `long double' (or any other floating type). The does not appear to matter in this particular example. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message