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 

Default Integer KIND 7 compiler option

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



Joined: 30 Sep 2020
Posts: 18

PostPosted: Sun Jan 17, 2021 7:02 pm    Post subject: Default Integer KIND 7 compiler option Reply with quote

FTN95 compiler has an option (/INTL), which set the default integer variables to KIND 3. However KIND 3 is not compatible with 64-bit compiler. Is there any option that set the default integer variables to KIND 7, i.e. KIND 3 for 32-bit compiler and KIND 4 for 64-bit compiler?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1561

PostPosted: Sun Jan 17, 2021 7:33 pm    Post subject: Reply with quote

As you can read in the documentation ( https://silverfrost.com/ftn95-help/x64/intro.aspx ), FTN95 permits you to specify KIND=7 for integer variables, which are then treated as KIND=3 for 32-bit programs and as KIND = 4 for 64-bit programs. This feature, however, is one that you have to modify your code to exploit (by specifying a KIND number in declarations).
Back to top
View user's profile Send private message
Moji



Joined: 30 Sep 2020
Posts: 18

PostPosted: Mon Jan 18, 2021 8:22 am    Post subject: Reply with quote

Thanks for sharing the link, but I am already aware of it. I was wondering, if there is an option that you can use as you compile the code that by using it, every variable of type INTEGER will become INTEGER(KIND=7) unless it is explicitly declared as other KINDs. I wanted to avoid manually set the KIND=7 for these integer variables.
You can see the /INTL description here:
https://www.silverfrost.com/ftn95-help/options/_intl_and_ints.aspx
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 18, 2021 9:02 am    Post subject: Reply with quote

The answer, in theory at least, is to use "/DEFINT_KIND 4" whenever you use /64 on the FTN95 command line.

I wonder what you mean by your comment that "KIND 3 is not compatible with 64-bit". There is no general need to upgrade the INTEGER KIND value when moving to 64 bits. The exceptions are where the INTEGERs are memory addresses and these can be changed to KIND=7.
Back to top
View user's profile Send private message AIM Address
Moji



Joined: 30 Sep 2020
Posts: 18

PostPosted: Tue Jan 19, 2021 9:31 am    Post subject: Reply with quote

Okay, I got it. Thank you both for the support
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