effect of free()

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Sep 10 20:39:12 AEST 1989


In article <29110 at news.Think.COM> barmar at think.COM (Barry Margolin) writes:
>What may be needed to satisfy everyone is a built-in operation that
>tells whether a pointer is valid to use.

My opinion is that if the programmer doesn't know that without applying
such a test, his code is out of control.

You might think that such a test would be useful in implementing
library routines, where the implementor has no control over the
user of his function and wants to "be gentle" when it is abused.
However, just because a pointer is valid does not mean that the
caller is using the function correctly.  So I think that even in
this case it would be of limited utility.



More information about the Comp.lang.c mailing list