From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e723b158fb4ad12e X-Google-Attributes: gid103376,public From: Niklas Holsti Subject: Re: Initialized global data Date: 1998/05/09 Message-ID: <3554A383.3F369AD1@icon.fi>#1/1 X-Deja-AN: 351777998 Content-Transfer-Encoding: 7bit References: <6iosc2$3mp@bgtnsc01.worldnet.att.net> Content-Type: text/plain; charset=us-ascii Organization: Telecom Finland News Service Mime-Version: 1.0 Newsgroups: comp.lang.ada,wellsk@netcom.com Date: 1998-05-09T00:00:00+00:00 List-Id: Kevin Wells wrote: > > When specifying data in an Ada package that is pre-initialized such as > ---------------------------------------- > package Generate_Matrix is > Scale_Factor : float := 10.903; > . > end Generate_Matrix; -- spec > ---------------------------------------- > > 1. Is it normal for the compiler to generate code that sets the value in > memory > (that gets executed when the runtime system is initialized)? > 2. Is there a way to get around this? In the compiler we have used most (TLD Ada 83, cross from Solaris to 1750A) there are a couple of compiler switches (-xtra -static_init) that can be used to eliminate the initialization code, in favour of data placed in the memory image for direct loading. Works only for _scalar_ variables though. The same is automatic for all _constants_, as far as I know. I know that you are using a different compiler, but perhaps a recheck of the available compiler options would turn up something -- probably you have already checked. Niklas Holsti Space Systems Finland