This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/40453] [F95] Enhanced (recursive) argument checking


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40453

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |accepts-invalid
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from janus at gcc dot gnu.org 2012-10-06 21:04:31 UTC ---
Here is a draft patch:

Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c    (revision 192159)
+++ gcc/fortran/interface.c    (working copy)
@@ -1063,6 +1063,19 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_s
   /* FIXME: Do more comprehensive testing of attributes, like e.g.
         ASYNCHRONOUS, CONTIGUOUS, VALUE, VOLATILE, etc.  */

+  /* Check interface of dummy procedures.  */
+  if (s1->attr.flavor == FL_PROCEDURE)
+    {
+      char err[200];
+      if (!gfc_compare_interfaces (s1, s2, s2->name, 0, 1, err, sizeof(err),
+                   NULL, NULL))
+    {
+      snprintf (errmsg, err_len, "Interface mismatch in dummy procedure "
+            "'%s': %s", s1->name, err);
+      return FAILURE;
+    }
+    }
+
   /* Check string length.  */
   if (s1->ts.type == BT_CHARACTER
       && s1->ts.u.cl && s1->ts.u.cl->length


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