Silverfrost Forums

Welcome to our forums

Character substring problem

9 Jun 2022 10:10 #29025

I am just beginning to port some programs from FTN77 to FTN95 and have come across a problem. The following example is similar to the one given on p162 of the User's Guide.

  CHARACTER FLTNO*6,AIRLN*2
  INTEGER*4 LA
  FLTNO = 'BA 748'
  LA = 2
  AIRLN = FLTNO(1:LA)
  END

With FTN77 this compiles and runs without a problem, assigning the value BA to AIRLN. With FTN95 it compiles but a run-time error occurs at the AIRLN = ... line, with the following message ...

Error 29: Call to missing routine : _CHECK_S_BOUND# at 0x00401059

Can someone please explain what is happening here?

9 Jun 2022 10:28 #29026

Sedgley

Please provide the FTN95 version number and the FTN95 command line arguments that you are using.

9 Jun 2022 10:36 #29027

The FTN95 version number is 8.80.0 Command line arguments /CHECK /UNDEF

9 Jun 2022 12:44 #29028

Your program works OK for me so please try v8.84 available for download from https://forums.silverfrost.com/Forum/Topic/3780.

9 Jun 2022 2:46 #29029

Thanks. I've download v8.84 but using it gives the same run-time error.

9 Jun 2022 3:32 #29030

My apologies. The missing routine will be in the updated salflibc.dll which you can download from the same place.

9 Jun 2022 4:07 #29031

Great. That's solved it. Thank you 😃

10 Jun 2022 2:48 #29032

I am puzzled, as I am using version 8.80.0 but can not reproduce the problem.

I also tried the following, to see if the unused AIRLN might have been removed, but both options work ok

CHARACTER FLTNO*6,AIRLN*2
INTEGER*4 LA
FLTNO = 'BA 748'
LA = 2
AIRLN = FLTNO(1:LA)
write (*,*) fltno
write (*,*) airln
END

With 'FTN95 airln.f90 /check /undef /link /map' CHECK_S_BOUNDS# is in the load map ?

Address   Name                                     File in which defined
 
Code

00401000    MAIN#                                    c:\temp\forum\lgotemp@.obj
                                                        (C:\TEMP\FORUM\AIRLN.F90)
00401000    main                                     c:\temp\forum\lgotemp@.obj
                                                        (C:\TEMP\FORUM\AIRLN.F90)
00401160    SALFStartup                              c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (/0             )
                                                        (\cpplib\nt_dll\salfstar.obj)
0040116a    SALFStart                                c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (/0             )
                                                        (\cpplib\nt_dll\salfstar.obj)
00401880    __undefined_function                     c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (salflibc.dll/  )
00401890    WSF1##                                   c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (salflibc.dll/  )
004018a0    CH#WSF                                   c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (salflibc.dll/  )
004018b0    CHECK_S_BOUNDS#                          c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (salflibc.dll/  )
004018c0    EXIT1#                                   c:\Program Files (x86)\Silverfrost\ftn95_8.80F\salflibc.lib (salflibc.dll/  )
0
10 Jun 2022 7:31 (Edited: 10 Jun 2022 8:59) #29033

The reference to the RTL routine CHECK_S_BOUNDS is generated by the compiler when options such as /undef are used. The routine itself is in one of the Silverfrost DLLs.

For a given compiler version such as 8.80, several different versions of the DLLs may have been released on different dates, and we do not know which DLL versions were used for the original post.

10 Jun 2022 8:51 #29034

Thanks to everyone for the help. I discovered that there was an old version of SALFLIBC.DLL in the system path. Correcting this has solved the problem. Mea Culpa.

Please login to reply.