Re: Proper way to return a string
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 30 Dec 2006 11:29:24 -0800
Steven G. Kargl <kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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,
No, that's not at all the subject in question. That's about *ALL*
assumed character length functions being obsolescent. I know that one
off the top of my head; it wouldn't have required research. In fact, I
several times have had to explain that one to people who misread it as
making assumed-length dummy arguments obsolescent; this surprises and
upsets them (and it would surprise and upset me also, but it isn't so).
Obsolescent things are still required to work. This is about some
particular cases of len=* functions being pointless (and apparently
illegal) to write because they can't be referenced.
As to your question in your other post about what other message I might
want... I don't actually care. The standard doesn't require anything
more - at least I don't think this ends up being one of the user errors
requiring diagnosis. The case is too rare and obscure for me to consider
it even much of a compiler quality issue. If you want to give another
message, it would be that a function with an assumed-length character
result has an explicit interface, but I don't personally think it worth
the effort of diagnosing the condition - unless it is really, really
simple to do.
The issue was more about whether compilers should be forced to allow the
pointless case that is probably a user error.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- 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
- Re: Proper way to return a string
- From: Richard Maine
- Re: Proper way to return a string
- From: Steven G. Kargl
- Proper way to return a string
- Prev by Date: Re: Proper way to return a string
- Next by Date: Re: allocation error
- Previous by thread: Re: Proper way to return a string
- Next by thread: Re: Proper way to return a string
- Index(es):
Relevant Pages
|
|