This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, gfortran] common blocks getting mangled in nested modules


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




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