On Fri, 31 May 2002, Archie Cobbs wrote: > 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. Bruce To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message