Microsoft KB Archive/68220

= FIX: Implicit AUTOMATIC Corrupts Subroutine Return Value =

Article ID: 68220

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q68220



SYMPTOMS
The 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.



RESOLUTION
Removing the AUTOMATIC statement fixes the problem, as does compiling with /Od.



STATUS
Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation, version 1.0.



MORE INFORMATION
The 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 query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00

Keywords: kbfix KB68220

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.