This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Use and rename bug: rings a bell?
- From: FX <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Fri, 18 Jan 2008 17:10:28 +0000
- Subject: Use and rename bug: rings a bell?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Qt+oTMzW/Jj1lTQ/fu5CToSgE4/3diW0LfL8i93PcJU=; b=Vgr4+cuYmNNruRGfFv/BMIii6eBEI+EOeLFKXnz1UVRfRjlcygtEPlT4RXEGaXBgOfvvaOk4KrTTf71uJPWnu/1ekhJ6ZHWqUOAEzqdwGZ2oI5OEaEciAnHpBwniw4cfUaRNmJ3Jh4YhBVoyf6Xuj4SUhKxaltBh3g+wVtAVLgM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Ru40gmSzTjyxtXMgzOesj6MHrvqM481xzyLkewGJ6TeQyXeIjwysEqZZg7p/UCiw3kAf6oNuYWhhkFDYyUqbJYv8Uo2aCdKkfCtmHqU0odfWyMze8+dlGpkI0edq1LdFP6Z4Vf8PAh3PEzM7ClY+rS2hAJq60KVPAwKdML1nBHY=
Hi all,
A colleague of mine is bitten by the following bug. I thought I'd post
it here before I open a PR, because I think there has been activity
recently on this USE statement with rename lists, so maybe someone's
dealing with it or is aware of an open PR:
I think both testcases below are valid, but gfortran rejects the
second one. They only differ in the order of USE statements.
$ cat test.f90
module common_init_conf
integer, allocatable, dimension(:,:) :: Nmoltype_phase
end module common_init_conf
subroutine read_initial_config_nml()
use common_init_conf, nmoltype_phase_com => nmoltype_phase
use common_init_conf
implicit none
integer :: nmoltype_phase
namelist /confNmoltypePhase/ nmoltype_phase
end subroutine read_initial_config_nml
$ gfortran -c test.f90 && echo OK
OK
$ cat test2.f90
module common_init_conf
integer, allocatable, dimension(:,:) :: Nmoltype_phase
end module common_init_conf
subroutine read_initial_config_nml()
use common_init_conf
use common_init_conf, nmoltype_phase_com => nmoltype_phase
implicit none
integer :: nmoltype_phase
namelist /confNmoltypePhase/ nmoltype_phase
end subroutine read_initial_config_nml
$ gfortran -c test2.f90
test2.f90:9.27:
integer :: nmoltype_phase
1
Error: Symbol 'nmoltype_phase' at (1) already has basic type of INTEGER
test2.f90:10.45:
namelist /confNmoltypePhase/ nmoltype_phase
1
Error: NAMELIST attribute conflicts with ALLOCATABLE attribute in
'nmoltype_phase' at (1)
--
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/