[Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun May 25 15:37:00 GMT 2008



------- Comment #3 from burnus at gcc dot gnu dot org  2008-05-25 15:36 -------
> Ok, this produces an impressive list of regressions.
> Many of those (e.g. actual_procedure_1.f90) seem to be related to
>   conf (external, dimension);   /* See Fortran 95's R504.  */
> I'm not sure if the constraint from R504 is implemented correctly here, or if
> it constrains too much.

As written, I believe that

R504 entity-decl is object-name [( array-spec )] [ * char-length ]
                                [initialization ]
                 or function-name [ * char-length ]

only restricts the use of:
  REAL, EXTERNAL :: func(10)
                        °°°°<- array-spec, invalid for function names
but not (a)

  REAL, EXTERNAL, DIMENSION(10) :: func

nor (b) the dimension of function results.

Despite my failure to find anything in the standard which rejects (a) all my
compilers reject it whereas all my compilers allow (b).

See also:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/bb371413b5cbe3d7


> Others testcases (like argument_checking_3.f90) fail because they define lots
> of specific interfaces, but no external implementation for those.
> So I guess they are actually invalid?

As I did not apply your patch, I fail to understand this problem. Ignoring the
problems with the rank mismatches and too few arguments, the program is valid
from the Fortran side. External means that the user somehow needs to provide
the foo,bar,foobar procedures, but that is outside of the scope of the Fortran
standard (except that also Fortran procedures can be external procedures). In
case of gfortran the linker would complain - but it should never reach that
point because of the compile-time errors.

By the way: The the rank mismatch dg-error and not dg-warning should be used in
argument_checking_3.f90. (However, dejagnu does not distingish.)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-05-25 15:36:59
               date|                            |


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



More information about the Gcc-bugs mailing list