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

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



Bruce Stephens wrote:

> 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.

Since the original message was a reaction to my patch: I know that `0' 
should be fine in C (at least with modern compilers) and personally I
prefer it. But using `NULL' is the convention used throughout the zsh
code, so...

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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