[Bug fortran/55762] New: Diagnostic: Passing a procedure to LEN should tell that one has passed a procedure

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 20 16:03:00 GMT 2012


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

             Bug #: 55762
           Summary: Diagnostic: Passing a procedure to LEN should tell
                    that one has passed a procedure
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Reported at http://gcc.gnu.org/ml/fortran/2012-12/msg00145.html

"s" is declared as CHARACTER, but it is also used as "s(i)", hence, it is
marked as function. That leads to the error message:

      n = len(s)
              1
Error: 'string' argument of 'len' intrinsic at (1) must be CHARACTER


It would be more helpful to state that "S" is a function (procedure) in this
case - as NAG or g95 do:

  Error: Argument STRING to the LEN intrinsic is a procedure
  Type of argument 'string' in call to 'len' at (1) should be CHARACTER(1), not
PROCEDURE



More information about the Gcc-bugs mailing list