PRB: L1103 From DATA Initialization Beyond End of Array

Last reviewed: July 19, 1995
Article ID: Q88012
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.1
  • Microsoft FORTRAN for OS/2, version 5.1

SYMPTOMS

Compiling and linking code that contains a DATA statement that uses an implied DO-loop to initialize an array in a COMMON block and that implied DO-loop initializes beyond the end of the array may cause the following linker error:

   fatal error L1103: attempt to access data outside segment bounds

CAUSE

The compiler is not issuing an error message when the DATA beyond the end of the array is being allocated. This causes the object module to contain data initialized past the end of the COMMON block and crossing a segment bound.

RESOLUTION

Make sure that all DATA statement initializations of data in COMMON blocks are within the bounds of the data as declared.

This is not a problem in FORTRAN PowerStation.

MORE INFORMATION

The following code can be used to demonstrate the problem.

Sample Code

      integer*4 test(1)
      common /comtest/ test
      data (test(i),i=1,2)/7,8/
      end


Additional reference words: 5.10
KBCategory: kbtool kberrmsg kbprb
KBSubcategory: FLIss


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: July 19, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.