Re: Moving to AMD64 bit and porting issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can reliably use 0 as a null pointer constant with one exception.
When calling a varargs function which expects a pointer as an unnamed
argument, and when pointers are 64-bits but int is 32-bits, then you
must either use NULL or you must cast 0 to a pointer type.

Using NULL in this case is not portable; you *must*
use a cast to the exact pointer type that the
varargs function expects to see.  Different pointer
types can have different representation.


Segher


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux