FIX: F2124 with STRUCTURE, COMMON, and LOCFAR (77562)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q77562

SYMPTOMS

The following error message during pass two of the compiler:
F2124: Code Generation Error

CAUSE

This error message may happen when the following occur in combination:

  1. A STRUCTURE declaration, with a field declared as INTEGER*4.
  2. The STRUCTURE placed in COMMON.
  3. Setting the value of the LOCFAR function to a REAL number, when the LOCFAR function takes the INTEGER STRUCTURE element as an argument.

STATUS

Microsoft has confirmed this to be a problem in the products listed above. This problem was corrected in FORTRAN PowerStation.

MORE INFORMATION

The following code can be used to generate the error:

Sample code

        STRUCTURE /A2DStructure/ 
           INTEGER*4 Average
        END STRUCTURE

        RECORD /A2DStructure/ A2D
        COMMON /A2D/ A2D

             REAL*4 r
             r = 1.0
             r = r * LOCFAR(a2d.average)
        END
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:KB77562