On Jan 29, 2006, at 4:59 PM, Peter Shenkin wrote:
> A somewhat different but perhaps related example that arose for
> me when I was introducing F90 constructs into an F77 code was:
>
> call foo( a, b )
>
> where b was ALLOCATABLE but wasn't always allocated before
> the call was made. b was not referenced in foo if it had
> not yet been allocated....
> After some discussion, the consensus was that the wording of
> the standard did require the code to be accepted, though it
> wasn't the original intent of the standards body to allow it.
I don't recall that discussion, but if that was the conclusion, then it
has been fixed in f2003. The wording of the f2003 standard leaves no
room for debate - the code is illegal. From f2003 [269:23-24]
"Except in references to intrinsic inquiry functions, if the dummy
argument is not allocatable and the actual argument is allocatable, the
actual argument shall be allocated."
I didn't try to trace the history of this condition. This exact wording
clearly would not have been in f95, as it refers to dummy allocatables.
There might have been a comparable condition without the reference to
dummy allocatables, but I didn't go searching for it. If, as you say,
f95 originally allowed the code, but that was not the intent, then
there might well have been an interp edit to correct the standard. That
is the kind of thing the interp process is for.
> However, "needless to say," it was going to be a long
> time before the vendor in question provided me with a
> conforming compiler,
Changing the compiler isn't the only way to make such a thing
conforming. Fixing the standard also works. It doesn't make your code
work, but it makes the compiler standard-conforming.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|