This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
PRIVATE symbol in PUBLIC namelist
- From: "Janus Weil" <jaydub66 at googlemail dot com>
- To: "Fortran List" <fortran at gcc dot gnu dot org>
- Date: Wed, 27 Jun 2007 22:45:34 +0200
- Subject: PRIVATE symbol in PUBLIC namelist
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=X6M9Wcsk0KLd941LZ35vt7u9TxrvQ2Mu6T1sbYaTy34m+okt04YDF0o0yxvKcdk0UMNEqyIMpLZAKwbgNdwZcih3kXzgxziBCIUoDV6FU5htFE3g415yMWpu5tipg4BUHzOcvamUusBWXEkHub3OR9F+1QGOEs4x8PF2e/UQpZA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=H7M+3nB3v+xmlRnvIzWjzUj9sx0TNMWLnGyi9jzEyzm2u/i2BvlnTaJh45J1dCxtIr7x139aU8NeA1oH/DaqXNOQdumJEzpheg8NqBiVVzv/7CPWlR7EVl+yOCleSXhnqbXWYX6Cb+vKYLF1wsxSSqj+oxgSSL/xFE0Mpm4c+Dg=
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