[Info-vax] Technical issues with VMS BASIC port to x86-64 ?
Lawrence D'Oliveiro
ldo at nz.invalid
Tue Feb 20 22:27:04 EST 2024
On Tue, 20 Feb 2024 21:09:51 -0500, Arne Vajhøj wrote:
> I believe the example was somewhat similar to:
>
> program bad
> integer*4 a(2)
> common /m/a
> call s1
> call s2
> write(*,*) a(1),a(2)
> end
> c
> subroutine s1
> integer*4 a(2)
> common /m/a
> data a(1)/123/
> end
> c
> subroutine s2
> integer*4 a(2)
> common /m/a
> data a(2)/456/
> end
Looking at the Fortran 2018 spec, section 8.4, it says “A variable, or
part of a variable, shall not be explicitly initialized more
than once in a program”.
Also section 8.6.7 says “A variable whose designator appears as a data-
stmt-object or a data-i-do-object shall not be a dummy argument, accessed
by use or host association, in a named common block unless the DATA
statement is in a block data program unit, in blank common, a function
name, a function result name, an automatic data object, or an allocatable
variable”.
More information about the Info-vax
mailing list