FIX: L1103 and Initialization of Large Common Blocks

ID: Q58431


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0, 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 query words: 5.00 5.10

Keywords :
Version : :5.0,5.1
Platform :
Issue type :


Last Reviewed: November 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.