On Fri, 7 Sep 2001, Bakul Shah wrote:

> > out-of order is probably ok for a buffer if you know that it's
> > presently yours to write into.
> If the area being bcopied/bzeroed has this behavior why not
> remove the volatile from the struct ptrs instead of "fixing"
> bcopy/bzero?

One reason is that the memory might be normal at the time of the bcopy
(because you have locked out concurrent accesses to it), but volatile
at other times.  I think this should be handled in general by declaring
it as normal and always locking it.

> > 2/ add to the prototype of bzero and bcopy so that volatile pointers are
> > acceptable
> > arguments. (I don't see any reason to not do this).
> Because the (informal) defn of bcopy/bzero does not allow
> volatile arguments.  You are wagging the dog.
> Why not just cast these ptrs at the call sites where you
> _know_ bcopy, bzero use is safe.  That sort of documents what
> is going on without opening a big hole.

FreeBSD turns on -Wcast-qual in order to prevent inadvertant loss of
type qualifiers, so using explicit casts just moves the warning from
the implicit casts caused by the prototype to the implicit casts.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to