This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: write recursive call


Craig Powers wrote:
Pierre-Matthieu anglade wrote:
So, If I fixe this, it should be disabled when strict f77 or F90 or
F95 is asked, enabled for F2003 and enabled by default?

At the risk of saying something blindlingly obvious, note that recursive I/O is not, generally, something you can detect at compile time, and I don't recall whether I've seen that the runtime library has switchable standardization.

A good point -- thus, it may not be possible to disable it when strict f95 compliance is requested.


However, it's worth noting that the standard does not require the compiler to diagnose this problem -- merely that the standard does not permit standard-conforming code to use recursive I/O. Thus, it is perfectly permissable for a standard-conforming compiler to "correctly" compile non-standard code that has recursive I/O in it.

I would further note that the idea of having the runtime library aware of the "standardization" options is a very tricky thing to define, much less implement. Suppose that I write a code A that has a write statement that calls a function in code B which has an internal write in it. Further suppose that I compile code A with -std=f95 (which hypothetically disallows recursive I/O), and compile code B with -std=gnu (which hypothetically allows it), and then link them. Should the recursive I/O call produce an error, or not? What if I reverse the flags? I don't think there's a clear or meaningful answer there.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]