This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35299] scope of variables in statement function do not acquire rank from host
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Feb 2008 17:53:40 -0000
- Subject: [Bug fortran/35299] scope of variables in statement function do not acquire rank from host
- References: <bug-35299-10110@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2008-02-29 17:53 -------
I disagree. In Fortran 2003 12.5.4, C1263/R1238 says "The function-name and
each dummy-arg-name shall be specified, explicitly or implicitly, to be
scalar.". Intel accepts it, but IBM, g95 and (most importantly) Lahey think
it's invalid.
However, the error message should point to the statement function. The patch
below gives, in my opinion, a better error message:
HSTAR(E,B)=B**.4*((1.25*FUN(-E/40)+.18)) ! Doesn't work.
1
Error: Argument 'e' of statement function 'hstar' at (1) must be scalar
Index: resolve.c
===================================================================
--- resolve.c (revision 132578)
+++ resolve.c (working copy)
@@ -240,8 +240,9 @@
{
if (sym->as != NULL)
{
- gfc_error ("Argument '%s' of statement function at %L must "
- "be scalar", sym->name, &sym->declared_at);
+ gfc_error ("Argument '%s' of statement function '%s' at %L "
+ "must be scalar", sym->name, proc->name,
+ &proc->declared_at);
continue;
}
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Keywords|rejects-valid |diagnostic, patch
Last reconfirmed|2008-02-23 20:22:34 |2008-02-29 17:53:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35299