[Info-vax] Attn VSI employees: Viable full system Itanium emulator for VMS ?

Arne Vajhøj arne at vajhoej.dk
Mon Feb 21 09:51:05 EST 2022


On 2/21/2022 9:41 AM, Arne Vajhøj wrote:
> On 2/20/2022 10:42 PM, Dave Froble wrote:
>> On 2/20/2022 3:31 PM, Bill Gunshannon wrote:
>>> On 2/20/22 13:44, Hans Bachner wrote:
>>>> Arne Vajhøj schrieb am 20.02.2022 um 02:10:
>>>>> On 2/19/2022 1:05 PM, John Reagan wrote:
>>>>>> Nobody has used a COMMON block in one place with an integer and in 
>>>>>> another
>>>>>> with bytes?  Or a C union or a Pascal variant record?
>>>>>
>>>>> I would use EQUIVALENCE and not COMMON for that, but it could be done
>>>>> with COMMON.
>>>>
>>>> EQUIVALENCE is usually used when you need access to both definitions 
>>>> within
>>>> the same program unit. (Named) COMMON can be used to use different 
>>>> definitions
>>>> for the same memory area in different program units.
>>>
>>> Using different COMMON block definitions for the same COMMON block
>>> in different parts of the same program is usually considered very
>>> bad practice and can result in some rather weird and very hard to
>>> track down problems.
>>
>> Why?
>>
>> All a COMMON block is, is a piece of memory.  Isn't it possible to 
>> want to look at it in different ways?
> 
> It is error prone, because there is no check of consistency and a it
> requires a search to find the instances.
> 
> EQUIVALENCE is local and therefore very visible.

And to help the non-Fortran people:

$ type b1.for
       program b1
       integer*4 i4
       common /bb/i4
       i4 = 1
       call b2
       end
$ type b2.for
       subroutine b2
       integer*1 i1(4)
       common /bb/i1
       write(*,*) i1(1), i1(2), i1(3), i1(4)
       return
       end
$ for b1
$ for b2
$ link b1 + b2
$ run b1
    1    0    0    0
$ type b.for
       program b
       integer*4 i4
       integer*1 i1(4)
       equivalence (i4, i1)
       i4 = 1
       write(*,*) i1(1), i1(2), i1(3), i1(4)
       end
$ for b
$ link b
$ run b
    1    0    0    0

Arne




More information about the Info-vax mailing list