Re: Proper way to return a string
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 30 Dec 2006 10:36:46 -0800
Walter Spector <w6ws_xthisoutx@xxxxxxxxxxxxx> wrote:
Richard Maine wrote:
an internal function with a len=*
result would be at least ... strange....
Hmm. I can't see how the calling routine could declare the length of a
char(len=*) internal function. That would be two different declarations
in the same scope. That probably effectively disallows them...
Yup.
Likewise is creating an INTERFACE block for such a routine legal?
The g95, gfortran, and Salford compilers compile it without complaint.
However IRIX f90 gives a big warning - basically saying the routine
would be uncallable. And Intel considers it a fatal error.
I recall this question comming up in an interp (or perhaps just
discussion). I'm having trouble recalling what the final answer was. At
one time I recall an answer much like what you report the IRIX compiler
as saying - that you could have such a function, but you couldn't
reference it. But I'm not sure that was the final answer. At least some
people objected to that as being, perhaps pedantically consistant, but
unhelpful; they might have ended up swaying a majority.
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.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Proper way to return a string
- From: Steven G. Kargl
- Re: Proper way to return a string
- References:
- Proper way to return a string
- From: Jeremy
- Re: Proper way to return a string
- From: Steven G. Kargl
- Re: Proper way to return a string
- From: Gordon Sande
- Re: Proper way to return a string
- From: Ron Shepard
- Re: Proper way to return a string
- From: Beliavsky
- Re: Proper way to return a string
- From: Richard Maine
- Re: Proper way to return a string
- From: Walter Spector
- Proper way to return a string
- Prev by Date: Re: Proper way to return a string
- Next by Date: Re: Proper way to return a string
- Previous by thread: Re: Proper way to return a string
- Next by thread: Re: Proper way to return a string
- Index(es):
Relevant Pages
|