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 Answer
1

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 :