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/35299] scope of variables in statement function do not acquire rank from host



------- 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


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