This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47569] [4.3/4.4/4.5/4.6 Regression] gfortran does not detect that the parameters for passing a partial string to a subroutine are incorrect
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 3 Feb 2011 07:46:21 +0000
- Subject: [Bug fortran/47569] [4.3/4.4/4.5/4.6 Regression] gfortran does not detect that the parameters for passing a partial string to a subroutine are incorrect
- Auto-submitted: auto-generated
- References: <bug-47569-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47569
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-03 07:46:17 UTC ---
(In reply to comment #4)
> I am guessing but I suppose ultimate pointer components should be included
> too?
Yes, however, "gfc_expr_attr (actual).pointer" does not work as "foo(1)" is
never a pointer (even if "foo" is one). Thus, one needs to do something like:
pointer = sym->n.sym->attr.pointer
and update it every time one accesses a component ref. (I have not thought
about pointer-returning functions, but one should not confuse them with
proc-pointer functions.)
> This raises a point, however. Relative to the message, the error seems to do a
> lot more :-) I feel a lunchtime peruse of the F2003 standard coming on.
I have in my incomplete draft patch also the following bits, which should be
included in the final patch:
- is valid (cf. F95 12.4.1.1; F2003 12.4.1.2),
+ is valid (cf. F95 12.4.1.1, F2003 12.4.1.2, F2008 12.5.2.4),
and
- gfc_error ("Element of assumed-shaped array passed to dummy "
- "argument '%s' at %L", formal->name, &actual->where);
+ gfc_error ("Element of assumed-shaped or pointer array passed to "
+ "dummy argument '%s' at %L", formal->name, &actual->where);