This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: getarg and iargc in gcc-4.0.2
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: "Dr. Germund Hojer" <germund dot hojer at servidor dot unam dot mx>
- Cc: fortran at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: Mon, 05 Dec 2005 23:41:55 +0100
- Subject: Re: getarg and iargc in gcc-4.0.2
- References: <op.s1bwfcp1dc3cx4@ekeby.fquim.unam.mx>
Germund,
The following works with gfortran
[prt@localhost svn]# cat demo.f90
program test_arg
character(80) :: buffer
narg = iargc ()
print *, "no. of args = ", narg
do i = 1, narg
call getarg (i, buffer)
print *, buffer
end do
end program test_arg
[prt@localhost svn]# ./a.out my arg your arg
no. of args = 4
my
arg
your
arg
Whilst not standard (as using -std=f95 will demonstrate), this is a
fairly common manifestation of argument reading in fortran.
Regards
Paul Thomas