0 or 0L for empty pointers?

Allan Sandfeld Jensen kde at carewolf.com
Fri Jun 23 10:51:09 BST 2006


On Wednesday 21 June 2006 10:59, Thiago Macieira wrote:
> David Faure wrote:
> >On Tuesday 20 June 2006 23:15, Michael Buesch wrote:
> >> On Tuesday 20 June 2006 20:02, Friedrich W. H. Kossebau wrote:
> >> > IIRC it was something with sizeof(long)==sizeof(void*) not always
> >> > true. Any experts?
> >>
> >> sizeof(long)==sizeof(void*) is an assumption in the linux kernel, at
> >> least. So it is true for all archs which are supported by linux.
> >> I don't know if there are archs supported by KDE for which this is not
> >> true, though.
> >
> >I was told that this assumption doesn't hold on Windows-64bit.
>
> No, it doesn't.
>
> All 32-bit machines I know use the ILP32 concept (ints, longs and pointers
> are 32 bits). All 64-bit Unixes I know are LP64.
>
> But Windows 64-bit isn't. It's P64: longs are still 32-bit. Worst of all:
> Microsoft brags about it :-)

Yes. But this is compiler dependent. All sensible compilers on Windows still 
treat long as sizeof(void*) or can be configured to do it. 

I doubt KDE could be compiled by MSVC anyway.

`Allan




More information about the kde-core-devel mailing list