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

Last reviewed: September 16, 1997
Article ID: Q106635
1.00 1.00a 5.10 | 1.00
MS-DOS          | WINDOWS NT
kbtool kbfixlist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.1, 5.0, and 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, and 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, version 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32, version 1.0

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


Additional reference words: 1.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: TlsMisc
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.