------- Comment #4 from burnus at gcc dot gnu dot org 2009-07-29 10:20 ------- FX: As you seemingly have a working cross compiler: Can you check the patch below?
(One does not need to consider the return value as gfc_return_by_reference deals with that. Only the last change is relevant, the others are just optimizations for performance. As all the hidden arguments are of the same type and as we do not care about the dummy name nor have an actual name, we just add (nstr) arguments of the char-len type.) Index: trans-types.c =================================================================== --- trans-types.c (revision 150203) +++ trans-types.c (working copy) @@ -2249,7 +2310,7 @@ gfc_get_function_type (gfc_symbol * sym) Contained procedures could pass by value as these are never used without an explicit interface, and cannot be passed as actual parameters for a dummy procedure. */ - if (arg->ts.type == BT_CHARACTER) + if (arg->ts.type == BT_CHARACTER && !sym->attr.is_bind_c) nstr++; typelist = gfc_chainon_list (typelist, type); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40898