gfortran & iargc/getarg

Erik Schnetter schnetter@uni-tuebingen.de
Wed Apr 7 14:30:00 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 07 April 2004 12:45, Paul Brook wrote:
> > 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.)

In principle, one would have to write a function

int iargc_ (void) { ... whatever ... {

and place it into the run-time library.  What remains to be solved is 
the correct integer type and the correct name mangling.  It might be 
that gfortran would have to use different run-time libraries depending 
on the default integer size.  The name mangling could be resolved with 
weak symbols, I guess.

- -erik

- -- 
Erik Schnetter <schnetter@aei.mpg.de>   http://www.aei.mpg.de/~eschnett/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAc922m3uiSwno3f0RAmD5AJ4/5rdtPh452vL7XQh2iELa1pFsDQCgplkH
VAhDPM6q0b9leL93yxqfMxg=
=CogW
-----END PGP SIGNATURE-----



More information about the Fortran mailing list