Re: Proper way to return a string



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
.



Relevant Pages

  • Re: Biggest Flaw In WoW
    ... Everyone should have to ability to advance their character at the same ... been easier to get high-end gear. ... requiring only the commitment of 5 people. ... Still it can be frustrating if these lowered requirements are still ...
    (alt.games.warcraft)
  • Re: Proper way to return a string
    ... wording you cite from f95 might have been the result of that discussion ... function may not have an explicit interface, ... Assumed character length for functions is an irregularity in the ...
    (comp.lang.fortran)
  • Re: What is "powerlevelling"?
    ... >> I've been playing a character for 3 weeks, and he's up to level 22. ... >> impossible to me, and not only that, requiring someone to be playing this ... Kill things that you have quests to kill. ...
    (alt.games.warcraft)
  • Re: Proper way to return a string
    ... CHARACTER(*) function 'str_junk' at is obsolescent in fortran 95 ... The 'obsolescent' message is a good catchall. ... Object "STR_FUNC" is a module procedure or an internal function so it must ... the IRIX compiler message is: ...
    (comp.lang.fortran)
  • Re: Find out color attributes for given input in text box
    ... Ch Lamprecht wrote: ... entered 'Google' and the G had the color of Blue, the 1st o was red, ... Is there a cget or Configure function that will work on character ... I get what I need without requiring more data. ...
    (comp.lang.perl.tk)