In <%E*****************@read1.cgocable.net> "Method Man" <a@b.c> writes:
Yea, I suppose not. It could return a NULL:
p = free(p);
I just think free()'ing p and setting p = 0 should be handled in one step
since the operations are closely related and it avoids programmer error.
Now, engage your brain and explain what's the point of nullifying p if
you don't also nullify *all* the other pointers currently pointing into
the memory block that is being deallocated.
And if a free() returning a null pointer is what you want, you can
trivially have it:
#define FREE(p) (free(p), (void *)0)
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email:
Da*****@ifh.de
Currently looking for a job in the European Union