External ptrs and arrays (was Re: p

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Nov 9 16:40:20 AEST 1989


In article <225800239 at uxe.cso.uiuc.edu> mcdonald at uxe.cso.uiuc.edu writes:
>... the actual standard is much more limited than the capabilities of C
>on normal machines like PDP-11's, VAX's, 8086's and 68000's.

A better way to look at it is that the Standard makes no promises that
cannot reasonably be upheld by all implementations.  A specific
implementation can have additional properties if the environment so allows.

By the way, the PDP-11 is the main example of a system where data and
function address spaces are distinct, and it was the first system for
which C was implemented.  Therefore your being "flabbergasted" by the
discovery that conversion between data and function pointers was not
guaranteed to work merely indicates the limits of your C experience.
Most C users seem to think that the way C happens to work on the first
system on which they use it is the way that C should be everywhere.
The advantage of learning what is and is not universally guaranteed is
that you are more likely to write code that ports to different systems
without hassle.  For many of us, that is an extremely important property.



More information about the Comp.lang.c mailing list