[vbox-dev] [PATCH 2/8] Fix an implicit conversion from pointer to bool

Jung-uk Kim jkim at FreeBSD.org
Fri Mar 27 16:38:27 GMT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 03/27/2015 05:54, Michal Necasek wrote:
> After a bit of internal discussion, we suspect that the flagged 
> instance does not in fact involve a pointer.
> 
> Could you please run the module through a preprocessor in your 
> compilation environment and either try to determine what the type
> really is, or send us the preprocessor output? It's unfortunately
> not so easy tell by looking at the actual source code.

I realized I misinterpreted the warning message.  My apologies.
Actually the warning was caused by "-Wnull-conversion" (turned on by
default).

/wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.24/include/VBox/vmm/cpum.h:515:10:
warning: implicit conversion of NULL constant to 'bool'
[-Wnull-conversion]
    if (!CPUMSELREG_ARE_HIDDEN_PARTS_VALID(NULL, &pCtx->cs))
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.24/include/VBox/vmm/cpumctx.h:87:18:
note: expanded from macro 'CPUMSELREG_ARE_HIDDEN_PARTS_VALID'
         || (   (a_pVCpu) /*!= NULL*/ \

FYI, "-Wnull-conversion" was inspired by GCC's "-Wconversion-null".

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-March/020160.html

You can read lengthy discussion about the warning here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35669

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVFYd8AAoJEHyflib82/FGi84H/R4yD2UTkh7PQbAdGJBoLmtX
eAcGLlNQWYHXvDVPvwj5DIAYNns8ccBB2JCihwjud4fir7MJfKP1uqsnY/UprBae
qD+1c7dlT/LMOULl5U6y6wxbYn3HMoHsYp/7f7897w3JdWXjhOrTQxcgjElu+Acr
Fd2oVvkkkxc7f1sFqI5XB2Pw7nXnXOqORn5ZT5R6n081Cz1ay5+hTg9zPzt2An/s
7U2usREQcX48CvUcpuuzGj8JFGhtrwi5tP4tudLiWtxVzO2AfUz/2APMrU4Q5doF
9NM1dxnq2jxpWpT6y2HQVo+JLA5exiDRX4uf5RR48DtpNwaCdk2LB7mKOkvo3LE=
=xVQc
-----END PGP SIGNATURE-----




More information about the vbox-dev mailing list