Fortran vararg intrinsics from C/C++
Paul Keir
pkeir@dcs.gla.ac.uk
Fri Jan 9 15:44:00 GMT 2009
Hi all,
Is there a way to call Fortran statements or intrinsics, which have a
variable number of arguments, from C/C++? I'm thinking of IO statements
such as "write", but also intrinsics such as "max" and "min".
I had the idea to generate my own Fortran stub subroutines; one for
each argument count that I needed for each case: e.g. max2i4, max3i4,
write1, write2 etc. But while nm can find other intrinsic names in
libfortran.o (say _gfortran_random_r4), I don't see any with
variable argument counts.
I guess this is because the gfortran compiler takes care of their
uniqueness itself. Is there then no option apart from printf and
my own custom C/C++ varargs versions. I had hoped I could use
libgfortran.a for all intrinsics.
Regards,
Paul
More information about the Fortran
mailing list