View previous topic :: View next topic |
Author |
Message |
StamK
Joined: 12 Oct 2016 Posts: 159
|
Posted: Wed Jun 07, 2017 2:10 pm Post subject: Strange warning... |
|
|
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.
Code: |
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
|
Code: |
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]
|
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Wed Jun 07, 2017 3:05 pm Post subject: |
|
|
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! |
|
Back to top |
|
|
StamK
Joined: 12 Oct 2016 Posts: 159
|
Posted: Wed Jun 07, 2017 3:35 pm Post subject: |
|
|
The RESULT(C_STRING) specifies the return. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Wed Jun 07, 2017 4:01 pm Post subject: |
|
|
I have made a note of this. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Wed Jun 07, 2017 4:01 pm Post subject: |
|
|
Yep, I guessed that. The question is, does FTN95 66-bit? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Tue Aug 06, 2019 4:55 pm Post subject: |
|
|
Various failures relating to this code have now been fixed for the next release of FTN95. |
|
Back to top |
|
|
|