Bruce Evans writes:
> > That is, what we really need is a more general audit for code that
> > writes into mbufs that might be read-only -- and, as one special case
> > of tha, code that calls M_TRAILINGSPACE()/M_LEADINGSPACE() before writing
> > into an mbuf.
> >
> > FYI, any easy way to do this would be to add const'ness to mtod():
> >
> >     #define mtod(m, t)  ((const t)((m)->m_data))
> >
> > and then look for GCC warnings. Any takers?? :-)
> 
> This assumes that t is literally a pointer.  When t is caddr_t,
> `const t' is a const variable which (if caddr_t is `char *') is a
> pointer to non-const storage, but you want a non-const pointer to
> const storage.

Yep, you are right about that case... (as usual :-)

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

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

Reply via email to