gfortran & iargc/getarg
Paul Brook
paul@codesourcery.com
Fri Apr 9 04:14:00 GMT 2004
> > > A related question: What is the type name, in C, for a default
> > > Fortran integer? Is it index_type?
> >
> > There isn't one, because the default integer type can be set at
> > runtime (with the -i8 option). You need to provide both kind=4 and
> > kind=8 versions in the library. Then make sure the frontend resolves
> > the intrinsic to the correct one. There are several other intrinsics
> > which do this.
>
> Yes, that would be the case for intrinsics. But iargc and getarg are
> not intrinsics; they are just an external function and an external
> subroutine that happen to be in the run-time library. The user has
> e.g. to declare iargc before he/she can use it, which would not be
> necessary for intrinsics. (This is done that way because these
> procedures are not part of the Fortran standard. Making them
> intrinsics would surprise people who have written their own routines
> with these names.)
I disagree. g77 handles iargc as an intrinsic function.
It should be (but currently isn't) possible to disable these extra intrinsics
with a commandline option. This would keep the roll-your-own people happy.
We can't have different libraries for different default integer kinds because
it is possible to compile different parts of a program with different default
integer kinds, provided you are careful.
Paul
More information about the Fortran
mailing list