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

Michael Thayer michael.thayer at oracle.com
Fri Mar 27 07:17:48 GMT 2015


On 26.03.2015 20:48, Jung-uk Kim wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 03/26/2015 15:25, Michal Necasek wrote:
>> Sorry, I wasn't clear. By "what is the semantic difference" I meant
>> "under what circumstances will the conditional behave differently".
>> There must be some difference because otherwise what would be the
>> point of a warning?
>
> As I said, it does not behave differently under any circumstances.  It
> just shuts up compiler warnings.  I think the warning is to make sure
> its author is using a correct variable, i.e., "A variable of type foo
> is used where type bar should be used.  Do you really want me to
> convert it to type bar?" or something like that.
>
> Some people say it's too noisy but I didn't write the compiler. :-P

I wonder whether it would not make sense to at least get in touch with 
the compiler people here to find out their rationale for the warning and 
potentially open a bug report with them - "if (ptr)" is a very 
well-established convention in C and C++ programming.

Regards,

Michael
-- 
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher




More information about the vbox-dev mailing list