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 

Improper argument to UPCASE@ not caught even with /checkmate

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



Joined: 31 Oct 2006
Posts: 1181

PostPosted: Tue Sep 03, 2019 5:21 pm    Post subject: Improper argument to UPCASE@ not caught even with /checkmate Reply with quote

Would it be possible to provide built-in interfaces to the Silverfrost utility functions and subroutines such as UPCASE@?

In the following test program, I made the mistake of passing a similarly named integer variable instead of a character variable to UPCASE@. Even with /checkmate, the program crashes with access violation, whether built for 32-bit or 64-bit.

Code:
program upc
!test program to show upcase@ bug
implicit none
integer :: ipc = Z'00636261'
character(4) :: cpc = 'pqr '
!
call upcase@(ipc)  !error, should have passed CPC instead of IPC
print *,ipc
print *,cpc
end program
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Sep 04, 2019 7:18 am    Post subject: Reply with quote

I have made a note to look into this.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2022
Location: Yateley, Hants, UK

PostPosted: Thu Sep 05, 2019 11:19 am    Post subject: Reply with quote

... and presumably, LCASE@

E
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 05, 2019 12:41 pm    Post subject: Reply with quote

Yes, thanks for the prompting.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1176
Location: Aerospace Valley

PostPosted: Sat Sep 07, 2019 2:18 am    Post subject: Reply with quote

What's meant by the request:-

Quote:
...provide built-in interfaces to ....


?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1181

PostPosted: Sat Sep 07, 2019 2:25 am    Post subject: Re: Reply with quote

John-Silver wrote:
What's meant by the request:-

Quote:
...provide built-in interfaces to ....


?


The compiler should know the types of arguments that built-in routines (whether standard "intrinsics" or Silverfrost extensions), and should be able to check that actual arguments in calls to such routines are of the correct types (or compatible, at least).
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Sep 11, 2019 2:11 pm    Post subject: Reply with quote

Argument type checking has now been added to FTN95 for UPCASE@, LCASE@ and about 80 other native intrinsics. This will be included in the next release of FTN95.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2022
Location: Yateley, Hants, UK

PostPosted: Thu Sep 12, 2019 1:26 pm    Post subject: Reply with quote

Paul,

That's excellent. There are loads of subprograms in FTN that have their origins in FTN77, and it's great that they are being kept up to date.

Is it possible to have a list of what the SF routines are, above and beyond what are in the standard, please? I keep forgetting to look in the FTN77 manuals.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 12, 2019 1:55 pm    Post subject: Reply with quote

Here is the list without the trailing @ or $. There are some native intrinsics that are currently not tested. In particular only routines ending in @ or $ are tested.

ALLOCSTR,APPEND_STRING,ATTACH,CENTRE,CISSUE,CLOCK,CLOSEF,CLOSEFD,
CNUM,COMPRESS,CONVDATE,COU,COUA,CURRENT_DIR,DCLOCK,DOSERR,DOSPARAM,
DOS_ERROR_MESSAGE,EMPTY,ERASE,ERROR,EXIT,FEXISTS,FILEINFO,FILE_EXISTS,
FILE_SIZE,FILE_SIZE8,FILE_TRUNCATE,FLUSH_FORTRAN_HANDLE,FORTRAN_ERROR_MESSAGE,
FPOS,FPOSLONG,FPOS_EOF,FPOS_EOFLONG,GETENV,GETENVIRON,GETSTR,GET_CURRENT_FORTRAN_UNIT,
GET_GSTORAGE,GET_GSTORAGE64,GET_KEY,GET_KEY_OR_YIELD,GET_PATH,GET_PROGRAM_NAME,
GET_STORAGE,GET_STORAGE64,GLOBALMEMORYSTATUS,LCASE,MKDIR,NONBLK,OPENF,
OPENR,OPENRW,OPENW,PRERR,PROCESSMEMORYINFO,READF,READFA,READFLONG,RENAME,
RETURN_GSTORAGE,RETURN_STORAGE,RFPOS,RFPOSLONG,RUNERR,SET_FILE_ATTRIBUTE,
SET_SEED,SLEEP,SLEEP1,SOUND,START_PPROCESS,START_PROCESS,TEMP_FILE,TEMP_PATH,
TRIM,TRIMR,UPCASE,WRITEF,WRITEFA,WRITEFLONG
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2022
Location: Yateley, Hants, UK

PostPosted: Thu Sep 12, 2019 2:06 pm    Post subject: Reply with quote

Paul,

Many thanks for the quick response.

I once had a school report that "Edward is easily amused." It was nearly 60 years ago, and I still am. It's that mischievous easily amused sense that makes me chortle ar 'READFA'. Perhaps it just needs to be complemented with 'DOFA' and 'PRINTFA' for completeness.

Eddie

PS. For those who don't understand the meaning of 'FA', please send me a PM and I will explain.
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