dk
Joined: 02 Feb 2007 Posts: 6
|
Posted: Tue Feb 06, 2007 8:33 pm Post subject: 2 compiler errors in CHARACTER functions |
|
|
hi,
when compiling the following (simplified) modules, 2 spurious errors are reported by FTN95:
1) Line 22, error 327 - In the INTERFACE to AFUNC1, the third dummy argument (A) was of type REAL(KIND=1), whereas the actual argument is of type INTEGER(KIND=3)
this is clearly erroneous, as the interfaces are correct. Indeed, a is the fist, not third, dummy argument.
2) Line 45, error 326 - FUNCTION BFUNC1 has been called with too few arguments.
again, a quick inspection shows the interfaces are correct.
these compiler errors occur only if the functions are of CHARACTER type. Has anybody else come across such errors?
ps - I run FTN95 from .NET2003. it appears these errors only occur when using Debug/Checkmate with .NET, but not Win32. Quite strange.
!========================
module amod
implicit none
contains
!---------------------------------------
function afunc1(a,b,c)
implicit none
real,intent(in)::a
real,intent(in)::b
integer,intent(in)::c
character::afunc1
! the error occurs whether or not a,b,c are actually used
write(afunc1,'(f9.2,i2)')a+b,c
endfunction afunc1
!---------------------------------------
function afunc2(a,b,c)
implicit none
real,intent(in)::a
real,intent(in)::b
integer,intent(in)::c
character::afunc2
afunc2=afunc1(a,b,c)
endfunction afunc2
!---------------------------------------
endmodule amod
!========================
module bmod
implicit none
contains
!---------------------------------------
function bfunc1(a,c)
implicit none
real,intent(in)::a
integer,intent(in)::c
character::bfunc1
! the error occurs whether or not a,c are actually used
write(bfunc1,'(f9.2,i2)')a,c
endfunction bfunc1
!---------------------------------------
function bfunc2(a,c)
implicit none
real,intent(in)::a
integer,intent(in)::c
character::bfunc2
bfunc2=bfunc1(a,c)
endfunction bfunc2
!---------------------------------------
endmodule bmod
!======================== |
|