https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30617

--- Comment #47 from anlauf at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #46)
> It might be possible to generate warning when a function that
> is called from the argument list of an external I/O statement
> does external I/O.  This would also generate false positives, for
> example for code like
> 
>    write (10,*) my_func(10.)
> 
> ...
> 
>   integer function my_func(a)
>      real, intent(in) :: a
>      write (20,*) 'In my_func: argument is: ', a
> 
> ...

... and there is no real restriction to only consider functions: any procedure
that can be called from my_func could do I/O on the same unit.

I am afraid we need to track the state of external units whether they are
already in use or not.

Reply via email to