From owner-freebsd-current Wed Feb 27 14:29:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 2A1C237B423 for ; Wed, 27 Feb 2002 14:29:27 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id g1RMSoX31270; Wed, 27 Feb 2002 14:28:50 -0800 (PST) (envelope-from dillon) Date: Wed, 27 Feb 2002 14:28:50 -0800 (PST) From: Matthew Dillon Message-Id: <200202272228.g1RMSoX31270@apollo.backplane.com> To: Julian Elischer Cc: FreeBSD current users Subject: Re: controversial fix or some errors breaking LINT References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :/* : * Note: the "volatile" below does not REQUIRE that the argument be : * volatile, but rather ony says that it is OK to use a volatile * i : * there. Same for the const. I know a const volatile sounds strange : * but it only indicates that either is acceptable. : */ :void bcopy __P((volatile const void *from, volatile void *to, size_t :len)); : :NOW we can get rid of lots of UGLY casting tricks here and there that :have been used to try UNVOLATILE things so thay they can use bcopy. :I suggest a similar addition to a few other standard operations. : :Hopefully the BUS-space stuff should be used eventually :but I'm not going to rewrite if_ie.c..... are you? :(I've also seem this used in the IPV6 code but I think :thye've been (yukky) cast'ed by now. : :julian I really don't like this. I mean, it will work.... but I really don't like this. Volatile in C will effectively prevent optimization of read and write accesses to the data the pointer is pointing at. Of course, this is bcopy(), which we implement in assembly, so again it will work for bcopy(). But it sets a very bad coding precedent. I would keep the casts. It reminds us that there is something funny going on. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message