Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2002 14:37:18 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        FreeBSD current users <current@FreeBSD.ORG>
Subject:   Re: controversial fix or some errors breaking LINT
Message-ID:  <Pine.BSF.4.21.0202271430140.97278-100000@InterJet.elischer.org>
In-Reply-To: <200202272228.g1RMSoX31270@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
ok so I leave it to other people to fix LINT
I'm not going near it any more

one small example:

../../../dev/ie/if_ie.c:1471: warning: passing arg 1 of pointer to
function discards qualifiers from pointer target type
../../../dev/ie/if_ie.c:1480: warning: passing arg 1 of pointer to
function discards qualifiers from pointer target type
../../../dev/ie/if_ie.c:1483: warning: passing arg 1 of pointer to
function discards qualifiers from pointer target type
../../../dev/ie/if_ie.c:1508: warning: passing arg 1 of pointer to
function discards qualifiers from pointer target type

it's so obviously the right way that
I'm amazed that there can even be discussion.
(except that I know Bruce didn't lik eit before)
(he and jhb just actualy created more errors in LINT by removing
a volatile on the definition of bzero in the kernel.)
(the above fatal errors are new and brought to you by the people who just
did that removal)

remember folks.. this is the kernel here..
what Posix says doesn't count INSIDE the kernel.

We deal wit devices inside the kernel.
we have a LOT of volatile stuff.
It may be worth creating a vbcopy and vbzero to handle
volatile stuff then.
(But I think it's a stupid thing to need to do)
the bus-space mess should have stuff to do this but
no-one who understands it has had teh energy to actually
fix this stuff with it. so we are stuck with a broken LINT.


On Wed, 27 Feb 2002, Matthew Dillon wrote:

> 
> :/*
> : * 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 
> 					<dillon@backplane.com>
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0202271430140.97278-100000>