https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107576

--- Comment #9 from anlauf at gcc dot gnu.org ---
Something like the following rejects NULL when there is no interface:

diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index 49dbd1d886c..62b325b726d 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -4160,6 +4180,14 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist
**ap, locus *where)
              return false;
            }

+         if (a->expr && a->expr->expr_type == EXPR_NULL)
+           {
+             gfc_error ("Passing intrinsic NULL as actual argument at %L "
+                        "requires an explicit interface", &a->expr->where);
+             a->expr->error = 1;
+             return false;
+           }
+
          /* TS 29113, C407b.  */
          if (a->expr && a->expr->expr_type == EXPR_VARIABLE
              && symbol_rank (a->expr->symtree->n.sym) == -1)

Reply via email to