detecting invalid pointers

Henry Spencer henry at utzoo.uucp
Thu Mar 9 03:45:56 AEST 1989


In article <15495 at cup.portal.com> Kevin_P_McCarty at cup.portal.com writes:
>Is there any guaranteed way to detect an out of range pointer,
>i.e., one which is supposed to point into an array but might not?

No.  There simply is no way to do this portably, since the results of
pointer comparisons (ignoring NULL for the moment) are well-defined only
within the array.
-- 
The Earth is our mother;       |     Henry Spencer at U of Toronto Zoology
our nine months are up.        | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list