array[-1] -- permitted?

Peter da Silva peter at ficc.uu.net
Sun Sep 25 01:06:34 AEST 1988


In article <816 at goofy.megatest.UUCP>, djones at megatest.UUCP (Dave Jones) writes:
> I missed some of the early postings on this subject.  Could someone
> be kind enough to bring me up to date?  Is the committee going to
> break this code?  If so, why, fer Pete's sake?

No, the comittee isn;t going to break that code. Those array references
are from a pointer pointing into the middle of an array back into the
earlier part of the array. This is legal. What is not legal is to have
a pointer point back before the beginning of an array, even if it is
not dereferenced, because there are architectures that do bounds checking
on pointer calculations and there are architectures like the intel 8086
family for which this is may not even be meaningful.

Personally, I think these architectures are the result of severe brain
damage or overdependence on marketing claims. But they're out there, and
have to be accomodated.
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?"            peter at ficc.uu.net



More information about the Comp.lang.c mailing list