Re: Proper way to return a string



"Steven G. Kargl" wrote:
...> function str_junk (a)
1
Warning: CHARACTER(*) function 'str_junk' at (1) is obsolescent in fortran 95

Is there some other warning you want?

The 'obsolescent' message is a good catchall. But in the situations that
we are discussing, something stronger should be issued. There are really
two cases here:

* When the function appears as a CONTAINed procedure - either as an internal
procedure, or as a module procedure,

* When the function is described in an INTERFACE block.

In the first case(s) the IRIX compiler message is:

f90-367 f90: ERROR STR_FUNC, File = bel1.f90, Line = 16, Column = 21
Object "STR_FUNC" is a module procedure or an internal function so it must
not be typed as an assumed-length character.


In the INTERFACE case, the IRIX compiler message is:

f90-1566 f90: WARNING STR_JUNK, File = bel2.f90, Line = 7, Column = 21
Assumed length character function "STR_JUNK" cannot be invoked. There is no
way to match caller/callee characteristics.

Walt
.



Relevant Pages

  • 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)
  • Re: copying character strings to smaller string
    ... I've been among the thought police on occasion. ... What are those reasons? ... that character* is obsolescent, but not why it was made obsolescent. ...
    (comp.lang.fortran)
  • Re: Character variable variable passed as a subroutine argument
    ... Assumed length character dummys are the only reasonable way to ... there is nothing obsolescent about assumed ... (And personally, I use the obsolescent syntax anyway, just because I'm ...
    (comp.lang.fortran)
  • Re: question on character-like variable defination
    ... James Giles wrote: ... type name itself or as a specifier on each variable being declared. ... The default length is one character. ... obsolescent. ...
    (comp.lang.fortran)