Re: MODULEand USE versus Argument Passing
Richard E Maine wrote:
(snip)
My "favorite" example of COMMON mismatches in "real life" came from
something like
COMMON /named/ blah, blah2, ..... , x,
$ y, z, blah3, ..., blah4, blah5
where the comma after the x was in column 73. Of course, this was in
fixed source form and with implicit typing in effect. Thus... there is
an implicitly typed variable named xy in the common instead of the
intended x and y. Naturally, the symptoms weren't obviously related to x
and y, which weren't even referenced in the scoping unit. Instead, blah4
and blah5 had problems because they weren't in the same position in the
common in this scoping unit as they were in other scoping units.
Maybe printing storage maps, and especially COMMON maps is a lost art
in compiler design. Compilers I used to know would print out a list
of variables and their storage offset. Then, for each COMMON, the
variables in it, including EQUIVALENCEd ones, and the offset from
the beginning of the COMMON block. It isn't too hard to check,
though exchanged variables take a little more work. Checking that
the last variable has the same address in all routines finds a large
number of possible mistakes.
Though one use such maps had was finding variables in storage dumps,
also a lost art.
-- glen
.