This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g77: Namelist entry as dummy argument: permitted by the Standard.
- To: craig at jcb-sc dot com, egcs at egcs dot cygnus dot com
- Subject: g77: Namelist entry as dummy argument: permitted by the Standard.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 16 Jun 1999 21:36:50 +0200
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
Hi Craig,
As I helped write up the interface between the Fortran Frontend and
libf2c on the handling of namelists, this could very wel be my fault:
subroutine a(i)
namelist /nam/ i
read(*,nml=nam)
end
evokes (gcc-2.95 prerelease):
$ /usr/rel/bin/g77 nam.f
nam.f: In subroutine `a':
nam.f:1:
subroutine a(i)
1
nam.f:2: (continued):
namelist /nam/ i
2
Invalid declaration of or reference to symbol `i' at (2) [initially seen
at (1)]
However, this is not prohibited by the Standard:
5.5 Namelist statement:
...
Constraint:
A namelist-group-object shall not be an array dummy argument with a
nonconstant bound, a variable with a nonconstant character length, an
automatic object, a pointer, an allocatable variable, or a variable that
has an ultimate component that is a pointer or allocatable.
...
[ the wording is that of the upcoming F2K standard, but the crux remains
the same: scalar dummy arguments are not excluded ]
--
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html