mecej4
Joined: 31 Oct 2006 Posts: 1762
|
Posted: Tue Jan 10, 2023 12:34 pm Post subject: Failure to detect undefined variable in a common block |
|
|
In the following program, one of the variables in a COMMON block is used before it has been defined.
Code: | !
program buggy
implicit none
external blkd
integer i,j,k,l,m,n
common /bb/i,j,k,l,m,n
integer ksum
ksum = i+j+k+l+m+n
print *,k,ksum
end program
!
block data blkd
implicit none
integer i,j,k,l,m,n
common /bb/i,j,k,l,m,n
data i,j,l,m,n/1,2,4,5,6/ !k is not defined
end
! |
Compiling with /undef in a 32-bit compilation yields an EXE that when run displays the error.
With /64 /undef, however, the error goes undetected. |
|