[PyKDE] Compiling sip 4.1.1, PyQt 3.13, PyKDE 3.11.3 onSolaris8micro-Howto

Giovanni Bajo rasky at develer.com
Mon Mar 7 13:16:23 GMT 2005


Holger Joukl <Holger.Joukl at LBBW.de> wrote:

> I know the reinterpret_cast is evil, but what´s *invalid* about it given
> that I know that int is the same as long on my machine?

int and long are different types, according to C++. The fact they have the
same representation on a given platform does not matter. Accessing an object
of type T1 through a pointer of type T2 (with T1 and T2 unrelated, and with
the exception of T2=char) is invalid as per the aliasing rules specified in
the ISO C++ standard. Modern compilers exploit this: if they see a long* and
an object of type int, they can assume that the long* will never point to
the int object, and thus will not be able to modify its contents in any way.

This is off-topic though :)
-- 
Giovanni Bajo




More information about the PyQt mailing list