FORTRAN and ar problem

list at decus.com.au list at decus.com.au
Tue Aug 14 23:58:08 AEST 1990


I seem to have a problem when archiving BLOCK DATA program units. Following is
a listing of a test.


	PROGRAM MAIN
	CHARACTER*1 CH1,CH2,CH3
	COMMON/CHARS/CH1,CH2,CH3
	CALL SEG
	END

	SUBROUTINE SEG
	CHARACTER*1 CH1,CH2,CH3,CH10,CH11,CH12
	COMMON/CHARS/CH1,CH2,CH3
	CH10 = CH1
	CH11 = CH2
	CH12 = CH3
	END

	BLOCK DATA LEO
	CHARACTER*1 CH1,CH2,CH3
	COMMON/CHARS/CH1,CH2,CH3
	DATA CH1/"A"
	DATA CH2/"B"
	DATA CH3/"C"
	END

When compiling the above code without archiving any of the routines the
program behaves as expected (eg. doing a dump in the debugger shows the
correct initial and final values).

When I archive the BLOCK DATA program unit and link, none of the variables
are initialised (eg. a dump shows null values). 

Has anybody else seen this, knows what's happening, has a work around (I'm
talking about 900 subroutines with 60 BLOCK DATA program units, so
specifying the BLOCK DATA units individually at link time is not going to
work.

Thanx in advance,
Leo List
SIR(Australasia)



More information about the Comp.unix.ultrix mailing list