Dick Hendrickson wrote:
> I don't remember for sure, but I think one reason was to avoid having
> more than seven subscripts in an array reference by using several
> components with several dimensions each. There didn't seem to be
> a clean way to resolve this. Limiting the total to only seven
> seems artificial (as do many other things) and allowing more than
> 7 is inconsistent with normal non-component-arrays. Allowing more
> than 7 for normal arrays is likely to be non-portable. Picking a
> number (like 15) is portable, saying "processor dependent" isn't.
Application of the "a number is portable; saying `processor dependent'
isn't" rule is sporadic. There are numerous places where the standard
could have applied the rule, for example in DO nesting depth, but
didn't. Instead, we have, in Subclause 1.4, on page 1:
"The standard does not specify
...
(3) The size or complexity of a program and its data that will exceed
the capacity of any specific computing system or the capability of
a particular processor."
My compiler manuals list limits for things like DO nesting depth, number
of dummy arguments, number of files open concurrently, .... The limits
are so ridiculously large that I've never had a portability problem
caused by excedding them in one instance and not in another.
So the question now becomes: Why does the standard put a particular
limit in this case instead of appealing to this rule?
One of my compilers puts a limit on array size, such that the magnitude
of the addressing offset (presumably in bytes), or any intermediate
result in the addressing offset calculation, shall not exceed 2^30.
The base-2 logarithm of this limit, viz. 30, would be a reasonable
"processor dependent" limit. The limit of seven is an anachronistic
artifact arising from the IBM 7094 architecture: The 7094 had seven
index registers.
It's time for this hard limit to be replaced by the general caveat on
page 1.
--
What fraction of Americans believe | Van Snyder
Wrestling is real and NASA is fake? | [log in to unmask]
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.
|