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: Array argument bounds checking
    ... can have such a module procedure, you can't directly reference it when ... It seems that you don't like assumed character length functions. ... any scoping unit invoking the function shall declare the ...
    (comp.lang.fortran)
  • Re: Array argument bounds checking
    ... it only with an implicit interface such as ... assumed character length = characteristic and characteristic shall ... be "consistent". ... can have such a module procedure, you can't directly reference it when ...
    (comp.lang.fortran)
  • Re: CHARACTER(3)
    ... in the standard and used in examples. ... see if a form of character type specifier were obsolescent. ... It would seem nice to remove obsolescent features from example, ...
    (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)