FIX: $DEBUG Does Not Trap Range Errors in Implied-DO Loops (106635)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 4.0
  • Microsoft FORTRAN Compiler for MS-DOS 4.1
  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 4.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS 1.0
  • Microsoft FORTRAN PowerStation for MS-DOS 1.0a
  • Microsoft Fortran Powerstation 32 for Windows NT 1.0

This article was previously published under Q106635

SYMPTOMS

Extended error handling (enabled by $DEBUG or /4Yb) does not catch array subscript out-of-range errors in implied-DO loops (it does not generate F6096).

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was fixed in FORTRAN PowerStation version 4.0.

MORE INFORMATION

To duplicate the problem, compile and run the sample code below, which generates no errors. Because the code writes to elements 11-20 of array J, the following should have been generated:
: run-time error F6096: $DEBUG
- array subscript expression out of range

Sample Code

C Compiler options needed: none
$debug
      parameter (n=20)
      integer j(10)
      j=1                      ! set entire array to 1
      write (*,*) (j(i),i=1,n)
      end
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbfix KB106635