From owner-freebsd-current Wed Feb 27 13:40:16 2002 Delivered-To: freebsd-current@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 3343137B400 for ; Wed, 27 Feb 2002 13:40:09 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020227214009.UXTV2951.rwcrmhc53.attbi.com@InterJet.elischer.org> for ; Wed, 27 Feb 2002 21:40:09 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA01968 for ; Wed, 27 Feb 2002 13:27:50 -0800 (PST) Date: Wed, 27 Feb 2002 13:27:48 -0800 (PST) From: Julian Elischer To: FreeBSD current users Subject: controversial fix or some errors breaking LINT Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 There are saveral places (e.g. if_ie.c) where data is copied out of a buffer that is shared with the hardware. The pointer to this is correctly labelled as "volatile", though at the time we will copy the data out we know it to be stable. the problem is that it uses "bcopy()" to do this, and that generates teh error message ../../../dev/ie/if_ie.c:1232: warning: passing arg 1 of `bcopy' discards qualifiers from pointer target type ../../../dev/ie/if_ie.c:1232: warning: passing arg 2 of `bcopy' discards qualifiers from pointer target type which is now fatal. Now since it is also possible to copy data INTO a volatile shared buffer it seems logical to allow bcopy to do so. A while ago I proposed the following patch: /* * 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message