View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1885
|
Posted: Thu Apr 18, 2019 2:49 pm Post subject: Failure to catch array assignment with mismatched shapes |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Thu Apr 18, 2019 4:13 pm Post subject: |
|
|
Thank you. I have made a note of this. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Fri Jul 12, 2019 5:56 pm Post subject: |
|
|
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
|
|