Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3014

Re: Fortran to C/C++ translation: a running example.

Path csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From gah4 <gah4@u.washington.edu>
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> (permalink)
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

Show key headers only | View raw


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.

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Fortran to C/C++ translation: a running example. Rock Brentwood <rockbrentwood@gmail.com> - 2022-05-16 12:27 -0700
  Re: Fortran to C/C++ translation: a running example. Thomas Koenig <tkoenig@netcologne.de> - 2022-05-17 14:59 +0000
  Re: Fortran to C/C++ translation: a running example. Lydia Marie Williamson <lydiamariewilliamson@gmail.com> - 2022-05-20 16:34 -0700
    Re: Fortran to C/C++ translation: a running example. gah4 <gah4@u.washington.edu> - 2022-05-21 09:31 -0700
    Re: Fortran to C/C++ translation: a running example. Thomas Koenig <tkoenig@netcologne.de> - 2022-05-21 17:24 +0000

csiph-web