%val(loc()) on sgi

From: Erwin Kalvelagen (erwin_at_webster.gams.com)
Date: 10/26/03


Date: 26 Oct 2003 15:55:17 GMT

Dear all:

What would be the reason that the SGI f90 compiler
refuses this construct:

subroutine test
character(len=10) s
s = 'hello'
call c_routine(%val(loc(s)),%val(len(s)))
end subroutine

The error message is:

call c_routine(%val(loc(s)),%val(len(s)))
               ^
f90-1125 f90: ERROR TEST, File = vallocx.f90, Line = 4, Column = 16
  Invalid type of argument for VAL intrinsic.

f90: SGI MIPSpro Fortran 90 Version 7.4 (f14) Sun Oct 26, 2003 07:45:32
f90: 5 source lines
f90: 1 Error(s), 0 Warning(s), 0 Other message(s), 0 ANSI(s)

This is not a show-stopper as I can fix this on the C side
and using loc(s) instead of %val(loc(s)) or I could even
just use "call c_routine(s)". This question is more out of curiosity.
I have seen this construct being mentioned explicitly in
MIPSpro f90 docs, so I am a little bit puzzled why it could
be refused.

----------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erwin@gams.com, http://www.gams.com/~erwin
----------------------------------------------------------------