forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange warning...

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
StamK



Joined: 12 Oct 2016
Posts: 56

PostPosted: Wed Jun 07, 2017 2:10 pm    Post subject: Strange warning... Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1683
Location: Yateley, Hants, UK

PostPosted: Wed Jun 07, 2017 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
StamK



Joined: 12 Oct 2016
Posts: 56

PostPosted: Wed Jun 07, 2017 3:35 pm    Post subject: Reply with quote

The RESULT(C_STRING) specifies the return.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5043
Location: Salford, UK

PostPosted: Wed Jun 07, 2017 4:01 pm    Post subject: Reply with quote

I have made a note of this.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1683
Location: Yateley, Hants, UK

PostPosted: Wed Jun 07, 2017 4:01 pm    Post subject: Reply with quote

Yep, I guessed that. The question is, does FTN95 66-bit?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group