Mail Archives: djgpp/1996/07/29/02:15:38
On Sun, 28 Jul 1996, Conrad Wei-Li Song wrote:
> Borland returns a NULL pointer on a malloc( (size_t)(0) );
The ANSI C Standard specifies that the behavior in this case is
implementation-defined. I guess if they say that, there are other
libraries out there that behave that way. Solution: don't call `malloc'
with a zero argument, period. (IMHO, whoever steps into a territory
marked with ``implementation-defined'' or ``undefined'' signs is just
looking for trouble.)
> Microsoft does not deallocate the passed memory block on a failed realloc.
That is what ANSI C specifies it should do. If you see a `realloc' that
behaves differently, then that other `realloc' is buggy.
- Raw text -