On Nov 7, 2004, at 12:20 PM, Tim Prince wrote:
> Since f95, it should be a bug, if a compiler has optimized away repeat
> calls to a function which is
> not declared PURE.
I do not know of any change in f95 that justifies such claim. I am
aware that people disagree on the interpretation of the standard in
this area, but to my knowledge, none of those disagreements are
fundamentally tied to differences between f95 and previous versions.
Yes, I know that f95 introduced PURE (well, ok, HPF introduced it, and
f95 picked it up from HPF), but introducing that new feature didn't
change the existing ones.
I also know that some people think that the standard *SHOULD* have done
pure differently and perhaps should have made corresponding other
changes in nonpure functions.
Though perhaps I misread your statement. When you said "it should be a
bug", I took that as an interpretation of the standard, but perhaps you
were instead describing what you think the standard should have done
instead of claiming that it actually did do so. Or perhaps you are
describing how you think compilers "should" act as a quality of
implementation issue distinct from the requirements of the standard.
I certainly don't want to reargue all the old points on this subject
(and I won't reply to any such arguments). I even tried very hard to
refrain from commenting that this appears to be a current example of a
problem that wouldn't happen if my advice were followed (namely, to
avoid counting on function side effects in practice regardless of
whether or not you think the standard guarantees them in theory).. but
I couldn't resist. :-(
I am only curious whether you see an actual difference in the standard
(as opposed to a difference that you think there should be) in this
area between f90 and f95 for nonpure functions.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|