Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: Fortran to C/C++ translation: a running example. Date: Sat, 21 May 2022 09:31:45 -0700 (PDT) Organization: Compilers Central Lines: 25 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-05-041@comp.compilers> References: <22-05-032@comp.compilers> <22-05-038@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="61175"; mail-complaints-to="abuse@iecc.com" Keywords: Fortran Posted-Date: 21 May 2022 13:25:58 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-05-038@comp.compilers> Xref: csiph.com comp.compilers:3014 On Saturday, May 21, 2022 at 8:54:47 AM UTC-7, Lydia Marie Williamson wrote: (snip on COMMON and EQUIVALENCE) > This is not exactly correct. It's "common blocks" that were handled in this > way. > In the Fortran source of Zork/dungeon, the "equivalence" statements and > "common blocks" were used together, so it's easy to get the issue confused. I > don't know if their being used together is something that always happened in > Fortran, or if it was just particular to this program. COMMON and EQUIVALENCE are closely related in the Fortran standard, and in the implementation by compilers. A variable equivalenced to a variable in common, is also in common. Such variable can extend the length of the common block, but only at the end, not the beginning. It used to be that compilers would print out a variable map, with the address, or offset, of each variable, and its length and type. That was often useful to be sure that the compiler did what you thought it did. Also, it would include the length of each common block, again good to check to be sure they agree with what you expect. The Fortran standard has a C interoperability feature that explains how Fortran features and C features work together.