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]

PRIVATE symbol in PUBLIC namelist


Hi all,
I just came across some strange behaviour of gfortran. Please consider
the following simple module:

module mo

implicit none
real,private:: a,b,c

contains

 subroutine sub
   implicit none
   namelist /nl1/ a,b,c

contains

   subroutine subsub
     implicit none
     namelist /nl2/ a,b,c
   end subroutine subsub

end subroutine sub

end module mo

When compiling this with gfortran I get the following error:

     namelist /nl2/ a,b,c
                 1
Error: PRIVATE symbol 'a' cannot be member of PUBLIC namelist at (1)

Apparently namelist nl1 is fine while nl2 is forbidden. I just don't
see why. It doesn't matter if sub is declared private or public. I
tried gfortran version 4.1, 4.2 and a recent trunk build. All give the
same error.
Can anyone tell me if this should be considered a bug or if there is
any reason for this behaviour (or a way to resolve it)?
Cheers,
Janus


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