Silverfrost Forums

Welcome to our forums

Strange warning...

7 Jun 2017 1:10 #19720

The following code works fine in 32bit, but in 64bit it gives a strange warning (shown below). If the function is outside a module, then the warning disappears.

MODULE TEST
CONTAINS
FUNCTION F_C_STRING_FUNC (F_STRING) RESULT (C_STRING)
    IMPLICIT NONE
    CHARACTER(LEN=*), INTENT(IN) :: F_STRING
    CHARACTER(LEN=1) :: C_STRING(LEN_TRIM(F_STRING)+1)
    INTEGER*4                      :: N, I

    N = LEN_TRIM(F_STRING)
    DO I = 1, N
      C_STRING(I) = F_STRING(I:I)
    END DO
    C_STRING(N + 1) = CHAR(0)

END FUNCTION F_C_STRING_FUNC

END MODULE TEST




FTN95/x64 Ver. 8.10.145 Copyright (c) Silverfrost Ltd 1993-2017]
    PROCESSING MODULE  [<TEST> FTN95/x64 v8.10.145]
0003) FUNCTION F_C_STRING_FUNC (F_STRING) RESULT (C_STRING)
WARNING - In a call to F_C_STRING_FUNC from another procedure, the first
    argument was of type CHARACTER(LEN=*), it is now INTEGER(KIND=4)
        NO ERRORS, 1 WARNING  [<F_C_STRING_FUNC> FTN95 v8.10.145]
    NO ERRORS  [<TEST> FTN95 v8.10.145]
7 Jun 2017 2:05 #19721

Regardless of any other error or compiler bug, don't you need a function return value? What type is the function - real? This modern Fortran stuff sure confuses the heck out of me!

7 Jun 2017 2:35 #19722

The RESULT(C_STRING) specifies the return.

7 Jun 2017 3:01 #19723

I have made a note of this.

7 Jun 2017 3:01 #19724

Yep, I guessed that. The question is, does FTN95 66-bit?

6 Aug 2019 3:55 #24161

Various failures relating to this code have now been fixed for the next release of FTN95.

Please login to reply.