FIX: L1103 and Initialization of Large Common Blocks

Last reviewed: September 11, 1997
Article ID: Q58431
5.00 5.10 | 5.00 5.10
MS-DOS    | OS/2
kbtool kbfixlist kbbuglist kberrmsg kbcode

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 5.0 and 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0 and 5.1

SYMPTOMS

The program below causes the following linker error:

   fatal error L1103: attempt to access data outside segment bounds

The program defines a common block of arrays that span multiple segments. The program then initializes the arrays in the common block. The error is generated because the program is initializing the arrays in a different order than they are specified in the common block.

RESOLUTION

The work-around is to initialize the arrays in the same order that they appear in the common block.

NOTE: It is also possible to generate an internal compiler error by making simple modifications to the source code mentioned above. However, the workaround, is the same: initialize arrays in the order they are defined in the common block. For an example, query on the following in this Knowledge Base:

   internal and compiler and error and F1001 and line and 185

STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.0 and 5.1. This problem was corrected in FORTRAN PowerStation.

MORE INFORMATION

The following program demonstrates the linker error L1103:

C ============ FORTRAN SOURCE CODE == Fragment #1 ===============

      real*8    test1, test2

      common /test/ test1(1000,10), test2(100)

      data test2 /100*0/
      data test1 /10000*0/

      end
C ===============================================================

The workaround is to initialize the arrays in the order they appear in the common block, as shown below.

C ============ FORTRAN SOURCE CODE == Fragment #2 ===============

      real*8    test1, test2

      common /test/ test1(1000,10), test2(100)

      data test1 /10000*0/
      data test2 /100*0/

      end
C ===============================================================


Additional reference words: 5.00 5.10
KBCategory: kbtool kbfixlist kbbuglist kberrmsg kbcode
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 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.