Microsoft KB Archive/77574

= DOCERR: Code in Manual Incorrect: COMMON and Equivalance =

Article ID: 77574

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q77574



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: KB77574

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.