diff options
Diffstat (limited to 'gcc/fortran')
| -rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/fortran/interface.c | 6 | ||||
| -rw-r--r-- | gcc/fortran/resolve.c | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 02ee593..5900b63 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2011-09-26 Janus Weil <janus@gcc.gnu.org> + + PR fortran/50515 + * resolve.c (resolve_common_blocks): Check for EXTERNAL attribute. + + PR fortran/50517 + * interface.c (gfc_compare_interfaces): Bugfix in check for result type. + 2011-09-22 Janus Weil <janus@gcc.gnu.org> PR fortran/41733 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 7cbe163..f65087b 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1121,13 +1121,13 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, { if (s1->attr.function && s2->attr.function) { - /* If both are functions, check type and kind. */ + /* If both are functions, check result type. */ if (s1->ts.type == BT_UNKNOWN) return 1; - if ((s1->ts.type != s2->ts.type) || (s1->ts.kind != s2->ts.kind)) + if (!compare_type_rank (s1,s2)) { if (errmsg != NULL) - snprintf (errmsg, err_len, "Type/kind mismatch in return value " + snprintf (errmsg, err_len, "Type/rank mismatch in return value " "of '%s'", name2); return 0; } diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 62750af..13ecf1c 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -905,6 +905,10 @@ resolve_common_blocks (gfc_symtree *common_root) gfc_error ("COMMON block '%s' at %L is used as PARAMETER at %L", sym->name, &common_root->n.common->where, &sym->declared_at); + if (sym->attr.external) + gfc_error ("COMMON block '%s' at %L can not have the EXTERNAL attribute", + sym->name, &common_root->n.common->where); + if (sym->attr.intrinsic) gfc_error ("COMMON block '%s' at %L is also an intrinsic procedure", sym->name, &common_root->n.common->where); |
