Freeing Volatile Pointer

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jan 3 16:02:28 GMT 2005


On Mon, Jan 03, 2005 at 02:53:51PM +0200, Peter Pentchev wrote:
>    free((void *)host_mem_resp_ptr, M_DEVBUF)
> 
> ...and you should be okay, unless you specifically pass -Wcast-qual to
> the compiler.  If you do, it will again give this warning, just because
> you have explicitly asked it to :)

Still better is using __DEVOLATILE from sys/cdefs.h, which does a cast to
uintptr_t first. This way, you even avoid this warning :)

Joerg


More information about the freebsd-hackers mailing list