[Info-vax] Possible C compiler static variable initialization problem.

glen herrmannsfeldt gah at ugcs.caltech.edu
Fri Feb 28 14:56:08 EST 2014


Joukj <joukj at hrem.nano.tudelft.nl> wrote:
> glen herrmannsfeldt wrote:
 
>> The Fortran rules are slightly different, in that you can have
>> any number of COMMON blocks specified (which don't initialize to
>> a specific value) and at most one in BLOCK DATA which can initialize
>> the value. 

> The COMMON block is nothing more than a pointer to a heap of statically 
> allocated memory that is mapped in each subroutine to a list of 
> variables. The mapping may vary within a program for subroutine to 
> subroutine. (Handy in the "old" days when RAM was expensive)
 
> In more modern Fortran (F90) one can define modules containing variables 
> which are "global" to the subroutines that include the module. 

Yes, but in both cases, as far as I know, there is no requirement that
one have a special attribute like the no-extern C case.

As well as I know it, module variables to the linker look just like
COMMON, but with a different name. (Hopefully one that can't
conflict with any COMMON block names.)

-- glen



More information about the Info-vax mailing list