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 

Buggy behaviour of SDBG64

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



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sun Jun 21, 2020 4:39 am    Post subject: Buggy behaviour of SDBG64 Reply with quote

SDBG64, version 8.62a, exhibits inconsistent behaviour when running the following program after the program was compiled using the FTN95 8.62.1 compiler with the /debug /64 options.

When the program is run up to a breakpoint set on line 27, the variables pane shows '0' for U1 instead of the correct value, 'E'. The debugger seems to think that U1 is REAL, rather than CHARACTER(1).

The same program, compiled with /check /64 and run with SDBG64, displays further odd behaviour. Initially, line 8 is highlighted. Pressing F7 twice moves the highlight to line 11, as if the body of function UCHAR1 was never entered. Pressing F7 again moves the highlight to line 20; note that U1 is shown as UNDEFINED. Pressing F7 four times moves the highlight to line 28, and the value of U1 is shown as -1.1801e-038, which was probably inferred from the bit pattern Z'80808080' used as the signature of 'UNDEFINED'. A 1-byte character variable is being seen as a 4-byte real variable. Pressing F7 once more returns control to line-10, and UCHAR now has the correct value 'E'.

The program is just a demonstrator, and rather meaningless otherwise.

Code:
Program UpCase
  IMPLICIT NONE
  INTEGER, PARAMETER :: NLEN=7
  CHARACTER(LEN=1) :: uchar
  CHARACTER(LEN=NLEN) :: name
!
  name = 'eld.dat'
  uchar = uchar1(name)
  PRINT *,'First character,upper-cased: ',uchar
  STOP

CONTAINS

FUNCTION uchar1(string) RESULT(u1)
  IMPLICIT NONE
  CHARACTER(LEN=*), INTENT(IN) :: string
  CHARACTER(LEN=1) :: u1, ch
  INTEGER, PARAMETER :: lower_to_upper = IACHAR('A') - IACHAR('a')
  ch = string(1:1)
  IF('A' <= ch .AND. ch <= 'Z') THEN
     u1 = ch
  ELSEIF('a' <= ch .AND. ch <= 'z') THEN
     u1 = ACHAR(IACHAR(ch) + lower_to_upper)
  ELSE      ! ... not alphabetic
     u1 = ch
  ENDIF
  RETURN
END FUNCTION uchar1

END PROGRAM
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Mon Jun 22, 2020 7:18 am    Post subject: Reply with quote

Thank you for the report.
Back to top
View user's profile Send private message Visit poster's website
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