Out of range pointers

Doug Gwyn gwyn at smoke.ARPA
Wed Sep 21 06:44:53 AEST 1988


In article <33547 at XAIT.XEROX.COM> g-rh at XAIT.Xerox.COM (Richard Harter) writes:
>As a side note, one argument for making x[-1] legal is that it permits
>you to use sentinels in both directions.  I don't see that this is a
>problem, regardless of architecture.  All that is required is that nothing
>be allocated on a segment boundary.

There is a considerable practical difference between this case and the
one for a pointer just past the last member of an array.  The [-1] case
can require reservation of an arbitrary amount of unused address space
below an actual object, whereas the other case requires no more than a
byte (or a word, depending on the architecture) of space reserved above.



More information about the Comp.lang.c mailing list