How to remopve "volatile" qualifier from pointer without warning from gcc?

mdf at mdf at
Sun Oct 30 16:12:55 UTC 2011

2011/10/30 Lev Serebryakov <lev at>:
> Hello, Hackers.
>  I need to pass "volatile void *" to API function, which takes
> "void*". gcc (on FreeBSD 8.2) emits warning, and as in FreeBSD-styed
> code warnings are treated as errors, program could not be built.
>  Manual casting gives warning, too...

See the __DEVOLATILE() hack that will do sufficient casting to silence
the compiler.  As with any compiler warning, silencing it incorrectly
comes with a risk...


More information about the freebsd-hackers mailing list