From owner-cvs-all Thu Apr 23 06:27:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA29379 for cvs-all-outgoing; Thu, 23 Apr 1998 06:27:00 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from hda.hda.com (hda-bicnet.bicnet.net [208.220.66.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA29374 for ; Thu, 23 Apr 1998 06:26:58 -0700 (PDT) (envelope-from dufault@hda.hda.com) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id JAA23418; Thu, 23 Apr 1998 09:22:58 -0400 (EDT) From: Peter Dufault Message-Id: <199804231322.JAA23418@hda.hda.com> Subject: Re: cvs commit: src/sys/sys time.h In-Reply-To: <19980423144743.33016@follo.net> from Eivind Eklund at "Apr 23, 98 02:47:43 pm" To: eivind@yes.no (Eivind Eklund) Date: Thu, 23 Apr 1998 09:22:57 -0400 (EDT) Cc: cvs-committers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > 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