On 3/13/07, Dave Korn <[EMAIL PROTECTED]> wrote:
On 13 March 2007 13:52, Paulo J. Matos wrote:
> Hello,
>
> When programming, due to my journeys through C++ recently, I've been
> using 0 instead of NULL. Strangely gcc compilation doesn't warn me
> about it. Is it ok to do this? (So far, I had no problems). Is there
> anything I should be aware when using 0 instead of NULL in gcc code?
Nope. (This is really a gcc-help@ question, but anyway....) Zero is
completely acceptable for a null pointer constant in all circumstances
*except* when passing to a varargs function, which can go badly wrong on
platforms where the sizeof a pointer is larger than the sizeof an int. See
the gnu coding standards, which mentions this.
Thank you, I only posted here because it was about standard coding in
gcc code. But should read the gnu coding standards indeed. Always
forget gcc is GNU. :)
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK