On Dec 30, 2011, at 12:44, Thomas David Rivers wrote:
>
> This frequently lulls C developers on MVS into believing the
> runtime there checks for dereferencing NULL and does something
> "meaningful" with it; or that, for example, strlen(NULL) returns
> 0...  but nope - it's just luck.
>
Actually, not entirely.  It was mentioned on MVS-OE several
years ago that many UNIX systems keep a 0 at location 00, and
many C programmers have come to depend on this behavior, however
incorrectly.  IBM got weary of problem reports, "But it works
on systems X, Y, and Z" that many library routines that used
to report "Invalid Pointer" were modified to substitute ""
for NULL and proceed accordingly.

-- gil

Reply via email to