[Info-vax] VMS Software Q1 '23 Update

Arne Vajhøj arne at vajhoej.dk
Wed Jan 25 19:54:20 EST 2023


On 1/25/2023 7:48 PM, John Reagan wrote:
> On Wednesday, January 25, 2023 at 6:50:20 PM UTC-5, Arne Vajhøj wrote:
>> That is horrible code IMHO.
>>
>> Initializing the same common block in multiple subroutines
>> is not something I would ever do.
>>
>> I would expect either an error or undefined result due to
>> order of processing being undefined.
>>
>> But then I don't know what the Fortran standard and the
>> VMS Fortran documentation says on the topic.
>>
>> Someone is actually using such constructs?
>
> Well, I expanded it from a customer program.  In the broken compiler, each subroutine
> with the partial/overlay initialization appended the values to the end.  The current
> Fortran cross-compiler will create a COMMON block that is several times larger by
> mistake.  A future compiler will match the Itanium and Alpha output.
> 
> Yes, legal Fortran of the day.

Many years ago I did a lot of Fortran, but it has been some years.

As I remember it then good practice was to have the common block itself
in an include to ensure consistency and to only initialize once - either
in a block data which I think was invented for this purpose or some
pre-determined place like the main program.

>                                  I don't get to pick and choose which programs to support.

I understand.

You have probably seen it before, but:
     https://xkcd.com/1172/

Arne




More information about the Info-vax mailing list