Date: Sun, 30 Oct 2011 09:12:53 -0700 From: mdf@FreeBSD.org To: lev@freebsd.org Cc: hackers@freebsd.org Subject: Re: How to remopve "volatile" qualifier from pointer without warning from gcc? Message-ID: <CAMBSHm8D1DBA2hmB_9c0-ZCquT7-u%2BjqD6OKB-p1gBcLe_KiGQ@mail.gmail.com> In-Reply-To: <1598895785.20111030200659@serebryakov.spb.ru> References: <1598895785.20111030200659@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
2011/10/30 Lev Serebryakov <lev@freebsd.org>: > Hello, Hackers. > > =A0I 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. > > =A0Manual 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... Cheers, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm8D1DBA2hmB_9c0-ZCquT7-u%2BjqD6OKB-p1gBcLe_KiGQ>