Re: Proper way to return a string



In article <1hr5m5e.japdtj1sxjdb3N%nospam@xxxxxxxxxxxxx>,
nospam@xxxxxxxxxxxxx (Richard Maine) writes:


Without going to the trouble of researching it more, I suspect that the
wording you cite from f95 might have been the result of that discussion
(implying that the discussion must have been about f90). It would seem
to make the cases in question illegal even if you don't reference the
function, presumably on the logic that a non-referenceable function is
pointless and probably not intended, so it is more helpful to disallow
it than to leave the presumed bug for later detection. If such a
function may not have an explicit interface, then that prohibits it from
being an internal or module function, and also prohibits writing an
interface body for such a function.


I think you want B.2.5.

B.2.5 Assumed character length functions
Assumed character length for functions is an irregularity in the
language since elsewhere in Fortran the philosophy is that the
attributes of a function result depend only on the actual arguments
of the invocation and on any data accessible by the function through
host or use association. Some uses of this facility can be replaced
with an automatic character length function,

--
Steve
http://troutmask.apl.washington.edu/~kargl/
.



Relevant Pages

  • Re: padding character string arguments
    ... SUBROUTINE trymisfit(dummy) ... With the -ansi option, Sun f95 did warn as it should, but it said ... character literal actual argument is an extension to the Fortran ... NAG f95 refused to compile it, and was the only one that was right IMHO: ...
    (comp.lang.fortran)
  • Re: Proper way to return a string
    ... function may not have an explicit interface, ... Assumed character length for functions is an irregularity in the ... assumed character length functions being obsolescent. ... requiring diagnosis. ...
    (comp.lang.fortran)
  • Substring in DATA implied-do
    ... I think both the f95 and f2003 standards forbid a program beginning thus: ... CHARACTER string*1025 ... END TYPE longstr ... reason for J3 to allow a substring in a data-implied-do only if it's a ...
    (comp.lang.fortran)
  • Re: Origin of Chinese spoken languages
    ... > You have better cite a dictionary published before 1900 AD. ... It also says that the character has variants Öö and Ál. ... ShangShu is one of the oldest texts in Chinese, the meaning of yi ²Ý used, ...
    (sci.lang)
  • Re: The Fuhrer Principle
    ... You just get bent when it's one ... > of your boys. ... Nah- your character issues would be on parade no matter whom you chose to ... >> cite please. ...
    (rec.martial-arts)