Silverfrost Forums

Welcome to our forums

ftn95 problem concatenating substrings of a string constant?

1 Apr 2019 12:23 #23413

I am trying to concatenate 2 substrings of a string constant using ftn95, version 8.30. For the ftn95 source file following, I created a 32 bit executable and a 64 bit executable. I am astonished that the results of the concatenation are different for the 32 bit and the 64 bit executable.

      CHARACTER*10 mystring10
      character*5 concatenate_string
      PARAMETER (mystring10='abcdefghij')
      concatenate_string=mystring10(1:2)//mystring10(5:7) !+ bad
      write(*,*) 'mystring10(1:2)=',mystring10(1:2)
      write(*,*) 'mystring10(5:7)=',mystring10(5:7)
      write(*,*) 'concatenate_string=',concatenate_string
      concatenate_string(1:2)=mystring10(1:2) !+ works
      concatenate_string(3:5)=mystring10(5:7) !+ works
      write(*,*) 'concatenate_string=',concatenate_string
      end

Output of the 32 bit version:

 mystring10(1:2)=ab
 mystring10(5:7)=efg
 concatenate_string=ab ab
 concatenate_string=abefg

output of the 64 bit version:

mystring10(1:2)=ab
 mystring10(5:7)=efg
 concatenate_string=abefg
 concatenate_string=abefg

I wonder if the 32 bit result is correct, because the result expected and produced by the 64 bit version (concatenate_string=abefg) is generated, as well, when compiling the source with INTEL 32 bit and INTEL 64 bit compiler.

Regards, Dietmar

1 Apr 2019 5:37 #23414

Dietmar

I can confirm this failure and I have made a note that it needs fixing.

20 Aug 2019 8:54 #24209

This failure has now been fixed for the next release of FTN95.

Please login to reply.