[vbox-dev] [PATCH 2/8] Fix an implicit conversion from pointer to bool
jkim at FreeBSD.org
Fri Mar 27 16:44:31 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
On 03/27/2015 03:17, Michael Thayer wrote:
> 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.
> 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.
I misinterpreted the warnings. It warns not because of "if (ptr)" but
because of "if (NULL)", i.e., "-Wnull-conversion" (Clang) or
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
More information about the vbox-dev