This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40898] STDCALL mangling problem for strings @8 instead of @4
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2009 10:20:56 -0000
- Subject: [Bug fortran/40898] STDCALL mangling problem for strings @8 instead of @4
- References: <bug-40898-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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