[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Keeping binary compatibility
From: Thiago Macieira <thiago () kde ! org>
Date: 2010-10-05 14:37:28
Message-ID: 201010051637.29084.thiago () kde ! org
[Download RAW message or body]
Em Terça-feira 05 Outubro 2010, às 14:21:58, Lubos Lunak escreveu:
> Thanks for saving me the work of refuting your first paragraph by doing so
> in your second paragraph :). And note that at least with gcc NULL already
> is nullptr in practice.
C++ is also happy to convert from pointer to bool if it can. That's why we
added the private constructor QVariant::QVariant(void*) to Qt 4.7.
The worst part in my opinion is that C++ also happily converts "false" to
pointer. (false is 0 and 0 can be a pointer)
$ g++ -fsyntax-only -xc++ - <<<'void foo(void *); int main() { foo(false); }';
echo $?
0
$ g++ -fsyntax-only -xc++ - <<<'void foo(void *); int main() { foo(true); }';
echo $?
<stdin>: In function ‘int main()':
<stdin>:1: error: cannot convert ‘bool' to ‘void*' for argument ‘1' to ‘void
foo(void*)'
1
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
Qt Developer Days 2010 - Munich Oct 11-13 - San Francisco Nov 1-3
For more information and to register: http://qt.nokia.com/qtdevdays2010
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic