gfortran compiles the following module a implicit none integer :: i = 42 end module a
module b use a implicit none private public a ! <-- Is this legal? Can change to private, too. end module b program c use b implicit none end program c Lahey's syntax checker gives Lahey/Fujitsu Fortran 95 Source Check Output Compiling program unit a at line 1: Compiling program unit b at line 5: 1725-S: "SOURCE.F90", line 10, column 10: 'a' already used as a module name. -- Summary: PUBLIC and PRIVATE abuse Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36251