1
votes

Is it possible to generate more than one Fortran 2003 interface to a single C function / procedure using intrinsic iso_c_bindings module?

I would like to have alternate interfaces for situation where C types of parameters do not match exactly Fortran ones, e.g. *float in C might be array, reference to single variable, or pointer (C_PTR_NUL).

1

1 Answers

4
votes

A F2003 compiler may complain if it detects that a same C procedure has two different interfaces. You need a F2008 compiler for that (this rule has been relaxed). This was the subject of a discussion on comp.lang.fortran few months ago. I don't find the right thread but the following one also mentions the problem :

http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/b1e8c8d0af9d16e8/bda981c3c4dddc97?lnk=gst&q=iso_c_binding#bda981c3c4dddc97