[Bug fortran/41603] [-fwhole-file] Add diagnostic for assumed-length character function

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Oct 6 17:56:00 GMT 2009



------- Comment #4 from burnus at gcc dot gnu dot org  2009-10-06 17:55 -------
(In reply to comment #2)
> c) "If an explicit specific interface is specified by an interface body or a
> procedure declaration statement (12.3.2.3) for an external procedure, the
> characteristics shall be consistent with those specified in the procedure
> definition

Richard Main thinks that this disallows it:

'The special rule for assumed length says that this characteristic has to be
 different, but this requirement says that the characteristic has to be
 "consistent." I do wish that were defined better, but from context hints
 I'd interpret "consistent" to mean "the same" for yes/no characteristics
 like assumed character length. If one tried to interpret "consistent"
 differently here, I'd wonder why that same interpretation wouldn't apply
 to the purity matter cited as an exception.

'I suppose there is some ground for uncertainly here based on the
 question of exactly how "consistent" is interpreted.'

I still do not quite see why it is allowed for implicit interfaces, but somehow
the following seems to allow it:

"If a type is specified for an external function, its function definition
(12.5.2.1) shall specify the same result type and type parameters."

(If it weren't allowed then one could not use it at all. And as it is a legacy
item, it must work without explicit interfaces which only exists since F90.)

Cf. http://groups.google.com/group/comp.lang.fortran/msg/3ea113a7b45471e5


-- 


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



More information about the Gcc-bugs mailing list