DOCERR: Code in Manual Incorrect: COMMON and Equivalance

ID: Q77574

5.10 | 5.10 MS-DOS | OS/2 kbprg kbdocerr ---------------------------------------------------------------------- The information in this article applies to: - Microsoft FORTRAN for MS-DOS, version 5.1 - Microsoft FORTRAN for OS/2, version 5.1 ---------------------------------------------------------------------- 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 reference words: 5.10 KBCategory: kbprg kbdocerr KBSubcategory: FORTLngIss

Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: July 18, 1995