Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cbatt!ihnp4!ihwpt!knudsen From: knudsen@ihwpt.UUCP (mike knudsen) Newsgroups: comp.lang.c Subject: Re: A Deficiency of the C Preprocessor Message-ID: <1334@ihwpt.UUCP> Date: Tue, 6-Jan-87 15:04:23 EST Article-I.D.: ihwpt.1334 Posted: Tue Jan 6 15:04:23 1987 Date-Received: Tue, 6-Jan-87 23:55:18 EST References: <1259@kontron.UUCP> <1888@batcomputer.tn.cornell.edu> <4863@mimsy.UUCP> <3820@utcsri.UUCP> Organization: AT&T Bell Labs, Naperville, IL Lines: 43 > >>As for compile vs. run time initialization of arrays: A compiler I > >>use creates code for all the initializations in the program ... > >>Even worse, when an array is initialized, this compiler generates a line > >>of code to initialize each entry, rather than an image of the array and > >>looping code. > >That sounds like a pretty poor compiler to me. Whose is it, that > >we may all avoid buying it? > > I have never seen a C compiler that does this, but I know of another > supposedly powerful language compiler that does. And of course there > If I say: > foo(){ > static int bar=0; > ... > then 'bar' must be set to zero sometime before the first call to 'foo', and > must *not* be set to zero on subsequent calls to foo. On braner's compiler, > does this work, and if so, how? Does the compiler put 'CLR bar' into a > separate code area which is executed at startup? This sounds like more > trouble than real initialization... How else to init this? He may be talking about the OS9 Level I C compiler from Microware, which I use all the time at home. It does indeed go thru agonizing space and time-consuming initializations on startup. The reason for this is that OS9 C is required to produce re-entrant, sharable object programs. That is, after I've been running such a program for a while, another process or user can start up that same program. He will use the same copy of pure code in RAM as I've been, but he has to get his own data area initialized from scratch. Unforch, this C doesn't have any "read-only" or "ROMable" declarations for initialized data that you promise not to alter while running. Since the program I'm writing will never be shared, I'd love to get around this waste, but .... -- Mike J Knudsen ...ihnp4!ihwpt!knudsen "It's like trying to get to sleep at the Intergalactic Spaceport Hotel -- waiting for the being in the room above to drop the Nth shoe, and you don't even know what N is."