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: PR 36322/36463


Janus Weil wrote:
>>> Just a preliminary comment: your first and third tests use recursive I/O.
>>> Not only it is invalid, but the executables freeze on Darwin.
>>>       
>> Shouldn't we have some kind of warning if this is invalid?
>>     
>
> I just had a look at http://gcc.gnu.org/wiki/Fortran2003Status, where
> one can find a big "YES" (in bold letters) under "recursive
> input/output". So I guess
> 1) it is valid (at least in Fortran 2003),
>   

Note: Fortran 2008 only allows recursive I/O which goes to another unit,
e.g.
   write(output_unit,*) f(x)
with in f(x)
   write(99,*) x
but not writing to the same unit.

> 3) your frozen executable should probably be considered a bug.
>   
Well, there might be a race condition of the locking which is not
trivially fixable - otherwise you would slow down valid code a lot.
Regarding printing an error, this would be possible at run time with
some -fcheck-recusive-IO.

Still, it would be interesting why it causes problems under Darwin but
not under Linux.

Tobias


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