Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Apr 1998 09:22:57 -0400 (EDT)
From:      Peter Dufault <dufault@hda.com>
To:        eivind@yes.no (Eivind Eklund)
Cc:        cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/sys time.h
Message-ID:  <199804231322.JAA23418@hda.hda.com>
In-Reply-To: <19980423144743.33016@follo.net> from Eivind Eklund at "Apr 23, 98 02:47:43 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> On Thu, Apr 23, 1998 at 08:36:32AM -0400, Peter Dufault wrote:
> > Given no specification for timerclear pre-existing behavior
> > should be maintained.
> 
> Pre-existing behaviour was added two weeks ago, and was wrong at that
> point (a non-parenthesized expression).  I did the change the day
> after the original code was committed, but had it in my tree for a
> while before committing it.

How can that be?  There's a bogus timerclear without a parenthesis
in every sys/time.h I have:

> * $Id: time.h,v 1.5 1994/10/10 00:58:36 phk Exp $
...
> #define	timerclear(tvp)		(tvp)->tv_sec = (tvp)->tv_usec = 0

> 
> > Given a specification that says it behaves as if it returns void
> > you're right.
> 
> AFAIK, the only specification for timerclear() is the code.  The code
> says it returns void.  Happy?  ;-)

You're right if it has really only been there for two weeks.  You're
wrong if it has been in a public header file for many years.

My rule of thumb for fixing globally visible unspecified behaviour
is whether or not you can haul someone into software court for
gross stupidity (yes, very US-specific).

It is debatable about pulling someone into software court for using
timerclear as an expression if it has been there for years, but
you can definitely haul them up if they use the fact that it is
not parenthesized, e.g., 

> timerclear(tvp) , 1; /* Pre-set both seconds and usec to 1 */

will send down you to the Cobol dungeons until well after Y2K.

So you can't un-expression it but you can certainly parenthesize it.

(Unless I missed the boat and we're not talking about a change
to timerclear - I'm starting to wonder)

Peter

-- 
Peter Dufault (dufault@hda.com)   Realtime development, Machine control,
HD Associates, Inc.               Safety critical systems, Agency approval

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?199804231322.JAA23418>