Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!snorkelwacker!spdcc!merk!alliant!fisher From: fisher@Alliant.COM (Larry Fisher) Newsgroups: comp.lang.fortran Subject: Re: Using RCS with Fortran Keywords: rcs data common Message-ID: <3522@alliant.Alliant.COM> Date: 8 Nov 89 22:31:12 GMT References: <600@caldwr.UUCP> Reply-To: fisher@alliant.Alliant.COM (Larry Fisher) Followup-To: <600@caldwr.UUCP> Distribution: usa Organization: Alliant Computer Systems, Littleton, MA Lines: 38 In article <600@caldwr.UUCP> rfinch@caldwr.UUCP (Ralph Finch) writes: > >I just started using RCS to maintain our Fortran programs. What I >wish to do is print the rcs id info for the main routine and each >subroutine, from the main program. >I have tried various combinations of static and save declarations in a >vain attempt to get the compiler to accept this. Is the problem the >use of the local data statement in each subroutine? The problem is that the compiler generates one data area in the .o file for the entire common block for which you have any data. If two separate routines both have a data declaration for the same common block, even if for different locations, then the linker is left with the task of deciding what to do. Since data areas in the .o file cover the WHOLE common block, there is no simple way for the loader to combine the two tables into a single common block image. The Unix standard format .o files do not lend themselves to having only parts of data areas defined, as is the problem in your case. >How can I easily >accomplish the goal of printing each subroutine revision from the main >program? My thought was to have a standard form of comment in each routine. The text in the comment would contain the $Id$ you showed in your example and would be read by some tool that ended up writing either a data file (that could be read by the main program) or writing a file that looks like a BLOCK DATA that defines the array elements for the common block (which could be compiled and linked with the rest of the program). -- Larry Fisher Domain: fisher@alliant.com Alliant Computer Systems UUCP: {mit-eddie|linus}!alliant!fisher Littleton, MA 01460 Phone: (508) 486-1449