Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 0 vs. NULL (RE: Worrisome warnings after recent patches)



Bernd Eggink <eggink@xxxxxxxxxxxxxx> writes:

> Andrej Borsenkow wrote:

> > What is the point of using NULL to initialize null pointer. The only
> > portable and official way is to use `0'(zero), that is garanteed to be
> > converted to whatever representation null pointer has on a given system.
> 
> No, this applies to C++ only, not to C. In C you should use the NULL
> macro or (void*)0.

There's an issue with arguments to functions which don't have
prototypes, but apart from that, the literal 0 as a pointer should be
fine in C.



Messages sorted by: Reverse Date, Date, Thread, Author