------- Comment #4 from rguenth at gcc dot gnu dot org 2006-02-24 11:28 ------- gfc_sym_type()
if (gfc_option.flag_f2c && sym->attr.function && sym->ts.type == BT_REAL && sym->ts.kind == gfc_default_real_kind && !sym->attr.always_explicit) { /* Special case: f2c calling conventions require that (scalar) default REAL functions return the C type double instead. */ sym->ts.kind = gfc_default_double_kind; type = gfc_typenode_for_spec (&sym->ts); sym->ts.kind = gfc_default_real_kind; } is asking for trouble. This kind of hack has to be repeated elsewhere, so we do not miss the type-mismatch between FOO and X. But the real solution looks like creating the correct kind for the return type in the first place like if it was written as REAL*8. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26440