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 

Odd bug in CHECKMATE mode

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 323
Location: Morrison, CO

PostPosted: Sat Mar 18, 2017 12:31 am    Post subject: Odd bug in CHECKMATE mode Reply with quote

The following code fragment prints the value of k twice. The result should be that K=1, then K=0.

However, if the default integer type is set to 2, the results show 1 and 441344.

If you compile this for RELEASE with the same options, the error does not occur.

If I change the type of "k" to INTEGER or INTEGER*2, the code will work as it should.

Code:

   character*1 ft_returned(1000000)
    integer*4 q,p,rows,cols,k
    do k=1,1000000
      ft_returned(k) = char(k)
    end do
    rows=7
    cols=15
    do p=0,rows-1
       do q=0,cols-1
          k = ichar(ft_returned((q)+(p*cols)+1))
          print *,k
          k = k / 64
          print *,k
          pause
       end do
    end do
    stop
    end
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 574

PostPosted: Sat Mar 18, 2017 1:27 am    Post subject: Reply with quote

The following simplified version of the code also shows the error.

Code:
program wbug
implicit none
character :: ft = char(1)
integer k
k = ichar(ft) / 64
print *,k
end


Compile with ftn95 /defint_kind 2 /check. Outputs 520.

Works correctly if /64 is added.


Last edited by mecej4 on Sat Mar 18, 2017 12:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Mar 18, 2017 8:24 am    Post subject: Reply with quote

Thank you. I have made a note of this.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 22, 2017 7:59 am    Post subject: Reply with quote

This has now been fixed for the next release of FTN95.
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 -> Support 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