|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
KL Guest
|
Posted: Fri Nov 24, 2006 5:36 am Post subject: "Undefined Array" |
|
|
Dear Paul,
The program �Test_Undefined_Array� documents an �error� when the undefined array A is used in the statement
C = A + B
Since the array A as a whole is undefined, this statement should lead with the appropriate compiler option /CHECKMATE to an error message. This is not the case. However, a statement such as
C (1,2) = A (1,2) + B (1,2)
does give an error message.
I have run the case with
del comp.lis
del *.obj
del *.exe
ftn95 Test_Undefined_Array.f95 /checkmate /link >> comp.lis
sdbg Test_Undefined_Array.exe
This is of course a programming error, but it should be detected with the appropriate option /CHECKMATE.
Below is the test programme:
Winapp
Program Test_Undefined_Array
Implicit None
Real , Dimension (2,2) :: A, B, C
B = 2.
A (1,1) = 1.
write (*,*) A
write (*,*) B
! Since only the first element of A is defined,
! it is not allowed to use A as a whole array.
! A as a whole is undefined.
C = A + B
! The following statement leads to an error
! C (1,2) = A (1,2) + B (1,2)
write (*,*) C
End Program Test_Undefined_Array
Best regards,
Klaus Lassmann
|
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Mon Nov 27, 2006 3:55 pm Post subject: "Undefined Array" |
|
|
I agree with Klaus, /undef does not apear to apply to array operations, such as "C = A + B" or "write (*,*) A", when using Ver 4.9.1. It does apply to variable expressions, such as "c(1,2) = a(1,2) + b(1,2)".
Has this always been the case ?
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Tue Nov 28, 2006 11:26 am Post subject: "Undefined Array" |
|
|
Klaus
This bug has now been fixed but the fix will not be included in the release that is about to go out.
Regards
Paul |
|
Back to top |
|
|
|
|
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
|