FIX: Implicit AUTOMATIC Corrupts Subroutine Return ValueLast reviewed: September 11, 1997Article ID: Q68220 |
5.00 5.10 | 5.00 5.10
MS-DOS | OS/2kbtool kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSThe program below should print out the value 9999 for 'j', after the call to subroutine X modifies it, but the original value of 5 is printed.
RESOLUTIONRemoving the AUTOMATIC statement fixes the problem, as does compiling with /Od.
STATUSMicrosoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation, version 1.0.
MORE INFORMATIONThe following sample demonstrates the problem.
Sample code
automatic
character*80 a, b
b = ' '
i = 10
j = i - 5
a = b(j:i)
write(*,*) 'j before call =', j
call X ( j )
write(*,*) 'j after call =', j
end
subroutine X ( k )
k = 9999
return
end
|
Additional reference words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |