DOCERR: Code in Manual Incorrect: COMMON and Equivalance

ID: Q77574


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.1
  • Microsoft FORTRAN for OS/2, version 5.1


SUMMARY

The sample program on page 132 of Advanced Topics version 5.0, page 105 Advanced Topics version 5.1 is incorrect. The code is as follows:


   integer a(10,20), b(20,30)
   common /cba/a, /cbb/b
   equivalence (a(10,20),b(1,1))
   end 
The ANSI standard states (p. 165 of REFERENCE manual):
An EQUIVALENCE statement cannot share memory between two different common blocks or between elements of the same common block.
Since the program attempts to equivalence items in two different COMMON blocks, the compiler generates the error:
error F2318: A, B : EQUIVALENCE : in different common blocks

Additional query words: 5.10

Keywords :
Version : :5.1
Platform :
Issue type :


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