-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 03/26/2015 04:51, Frank Mehnert wrote: > Hi, > > On Friday 13 March 2015 16:56:56 Jung-uk Kim wrote: >> This fix an implicit conversion from pointer to bool. > > why is this patch necessary? An expression like > > if (pointer) { } > > is completely valid and no compiler should warn about it. It tests > if the pointer has a value different from NULL.
Pointer is NOT bool. Actually, the pointer is *implicitly* converted to bool type here and compiler can warn about it. Excerpt from C++11: 4.12 Boolean conversions A prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member type can be converted to a prvalue of type bool. A zero value, null pointer value, or null member pointer value is converted to false; any other value is converted to true. A prvalue of type std::nullptr_t can be converted to a prvalue of type bool; the resulting value is false. > Would > > - || ( (a_pVCpu) /*!= NULL*/ \ + || ( a_pVCpu > \ > > fix the compiler warning as well? No, I don't think so. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVFEasAAoJEHyflib82/FGx2QH+QFvlUHYOpr7XvLgElyYMuQu hrm+ycpPH54xXf+zb9XGCnbLl4OBwil0Pe4SbLQ1W6feX2PufIcRaZmPfytUlE0W LHLAaFboeRTEBjbzfpqfDEADHsD4pEDFwp1zIZsL63snmqzdIyXwA47MPxMBmGLO /0KjHWbfUZ2crQZ4gKCgZDNvf4H43bRtDD8cF9D4YYKrRxpCc8jDTFThS05PcxkJ 1+i2LDCSAkRk/JrRpw2TLAjhDi3Bxvdbi7Hqg2MFh7j6GVaSatsqzuN5klQGTblt JJqsc9HfqfKHsOCWHti0WnUgmRguS2qAvGaIoP8NQ2UGArOWTii5GTTK9HOTmMA= =Dp1C -----END PGP SIGNATURE----- _______________________________________________ vbox-dev mailing list vbox-dev@virtualbox.org https://www.virtualbox.org/mailman/listinfo/vbox-dev