This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran, patch] Add PROTECTED support (PR23994) - committed


Tobias Burnus <burnus@net-b.de> wrote on Sun, 10 Dec 2006:
diff -u gcc/fortran/interface.c gcc/fortran/interface.c
--- gcc/fortran/interface.c     (working copy)
+++ gcc/fortran/interface.c     (Arbeitskopie)
@@ -1206,6 +1206,36 @@
 }


+/* Given a symbol of a formal argument list and an expression, see if + the two are compatible as arguments. Returns nonzero if + compatible, zero if not compatible. */ + +static int +compare_parameter_protected (gfc_symbol * formal, gfc_expr * actual) +{ + if (actual->expr_type != EXPR_VARIABLE) + return 1; + + if (!actual->symtree->n.sym->attr.protected) + return 1; + + if (!actual->symtree->n.sym->attr.use_assoc) + return 1; + + if (formal->attr.intent == INTENT_IN + || formal->attr.intent == INTENT_UNKNOWN) + return 1; + + if (!actual->symtree->n.sym->attr.pointer) + return 0; + return 0;
^^^^^^^^^^^^^^^^

As I just verified, this is not what you checked in :-)

+
+  if (actual->symtree->n.sym->attr.pointer && formal->attr.pointer)
+    return 0;
+
+  return 1;
+}

- Tobi


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]