Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2001 11:05:47 -0500 (EST)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sbin/dump optr.c
Message-ID:  <200110301605.f9UG5l925501@khavrinen.lcs.mit.edu>
In-Reply-To: <20011030110300.B622@straylight.oblivion.bg>
References:  <200110280613.f9S6Dlc96209@freefall.freebsd.org> <20011030110300.B622@straylight.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Tue, 30 Oct 2001 11:03:00 +0200, Peter Pentchev <roam@ringlet.net> 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




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