Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!hellgate.utah.edu!cc.utah.edu!rcapener From: RCAPENER@cc.utah.edu Newsgroups: comp.lang.modula2 Subject: Re: How to make libraries smaller? Message-ID: <66551@cc.utah.edu> Date: 29 May 90 01:52:46 MDT References: <9005281240.AA07902@mathematik.uni-ulm.de> Lines: 31 In article <9005281240.AA07902@mathematik.uni-ulm.de>, borchert@MATHEMATIK.UNI-ULM.DE (Andreas Borchert) writes: > Tom Tkacik writes: > [lots of stuff removed] > > If you want to be free of dependencies to your compiler and to your > environment you are enforced to produce a set of modules out of the > big one (that's what you've tried). But this implies that every > global variable is declared once and only once. Modula-2 doesn't > support common variables in the sense of Fortran or C. > Simply collect all global types and variables into one module and > import all that stuff in each of the other partitions. > [more stuff removed] I can see that this makes lots of sense for global types (very similar to C's typedef in an #include file), and will indeed work. But will variables be the SAME variables in all the modules that import it, or will they be DIFFERENT? It seems to me that it will be the latter, since the storage space will be allocated seperately each and every time you compile the object files that import it. I assume that this could be a compiler design issue, but is more likely to be a linker problem, but don't know for sure. Have you tested it with various compilers/linkers to see what they all do? It seems reasonable that you may be correct, but then again, is this really defined in the language standard? Sincerely rcapener@csulx.weber.edu (csulx was formerly wsccs)