Silverfrost Forums

Welcome to our forums

CAST to REAL/INTEGER in array constructor

22 May 2025 9:48 #32122

FTN95 version 8.95 added cast to CHARACTER(LEN=n) or to REAL within an array constructor. However the write statements in the code below show that the type conversion from integer to real is not occurring.

program p
implicit none
write(*,*)         [real :: 1,2,3] ! FTN95 prints integers not reals
write(*,'(3F6.3)') [real :: 1,2,3] ! Runtime error with FTN95 - format mismatch
end program p

Casting to integer is not supported in FTN95, perhaps this could be added to the wish-list? It was a program with the following call which caused me to look at this:

CALL SUB1([integer :: ])

i.e. SUB1 has as input an integer array of size zero (which does make sense following the programmer's methodology)!

24 May 2025 6:10 #32124

Ken

Thank you for the feedback. I have logged these issues for investigattion.

24 May 2025 1:24 #32125

These issues have now been fixed for the next release of FTN95.

Please login to reply.