[Patch, gfortran] common blocks getting mangled in nested modules

Paul Thomas paulthomas2@wanadoo.fr
Fri Aug 19 17:37:00 GMT 2005


Richard,

> As long as the local names end up different, one way or another, in 
> the scoping unit that USEs both modules, then there is nothing wrong 
> with using different modules which contain the same common block. This 
> needs to work.

I am just struggling with this at the moment.  This does not work, even 
with the patch:

module m1
  common /x/ a
end module m1
module m2
  common /x/ a
end module m2

program collision
  use m1
  use m2, only: b=>a
  b = 1
  print *,  b
end program collision

Cheers

Paul T





More information about the Fortran mailing list