FIX: Implied DO-Loop with Structure Causes Compiler Error

Last reviewed: September 16, 1997
Article ID: Q80536
5.10 | 5.10 MS-DOS | OS/2 kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, version 5.1
  • Microsoft FORTRAN for OS/2, version 5.1

SYMPTOMS

The MS FORTRAN 5.10 compiler can generate a Trap C protection violation under OS/2 or incorrect compiler errors under MS-DOS. The code which causes this problem contains an array of structures that is initialized in a DATA statement using an implied DO-loop.

RESOLUTION

Do not use implied DO-loops in DATA statements with arrays of structures. Use assignment statements or read the data from a file.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.10. This problem was corrected in FORTRAN PowerStation, version 1.0.

MORE INFORMATION

The following code reproduces the problem. Under OS/2 it generates a Trap C with the following error text:

   SYS1942: A program attempted to reference storage outside the
   limits of a stack segment.  The program was ended.

Under MS-DOS it generates the following error:

   fatal error F1900: maximum memory-allocation size exceeded

Sample code

      structure /s/
         integer*2 i
         real*4 r
         character*2 ch
      end structure
      record /s/ a(20)
      data (a(j).ch,j=1,3) /'h ','he','hj'/
      end


Additional reference words: 5.10 buglist5.10 fixlist1.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: FLIss
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.