Efficient coding considered harmful?

Henry Spencer henry at utzoo.uucp
Tue Nov 1 03:59:26 AEST 1988


In article <7421 at ihlpl.ATT.COM> knudsen at ihlpl.ATT.COM (Knudsen) writes:
>> 	for (p = &a[j]; --p >= a; )
>> which is nonportable.)
>
>Why not portable? ...

It terminates by running p off the beginning of a, and comparing it to
a to detect this situation.  The result of running a pointer off the
beginning of an array is (and always has been) undefined.  On some
segmented machines, this can and does cause trouble.
-- 
The dream *IS* alive...         |    Henry Spencer at U of Toronto Zoology
but not at NASA.                |uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list