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 

Failure to catch array assignment with mismatched shapes

 
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: 1885

PostPosted: Thu Apr 18, 2019 2:49 pm    Post subject: Failure to catch array assignment with mismatched shapes Reply with quote

Consider the following code, which is in error on Line-6 since the variable on the left and the expression on the right have different shapes.
Code:
program nph
implicit none
integer i,ijk,ia(1),ja(5)
!
ia = 123
ja = ia             ! Error, array shapes do not match
write(*,'(5i12)')ja
end

With /checkmate, 32-bit FTN95 V8.4 runs with no error messages and outputs
Code:
         123         123         123         123         123

The 64-bit compiler, with /checkmate, causes a run time error but the error is reported as the use of an undefined variable. Gfortran issues a clear error message at compile time:
Code:
Error: Different shape for array assignment at (1) on dimension 1 (5 and 1)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 18, 2019 4:13 pm    Post subject: Reply with quote

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


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

PostPosted: Fri Jul 12, 2019 5:56 pm    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 AIM Address
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