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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5bef5e9c5bedc675 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-02 11:33:57 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Per Sandberg Newsgroups: comp.lang.ada Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why? Date: Fri, 02 Jan 2004 20:31:53 +0100 Organization: Cuivre, Argent, Or Message-ID: References: Reply-To: per.sandberg@bredband.net NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1073071925 73052 80.67.180.195 (2 Jan 2004 19:32:05 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 2 Jan 2004 19:32:05 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: "Luke A. Guest" Return-Path: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en, sv In-Reply-To: X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:4045 Date: 2004-01-02T20:31:53+01:00 To avoid elaboration code is quite simple, just write all your packages in such a way that no elaboration code is needed. The simplest way to make this hapend is to add "pragma pure" or "pragma preelaborate" in all your specs. Then the compiler will force you to write the code in suh a way that no elaboration code is needed. /Per Luke A. Guest wrote: > On Fri, 02 Jan 2004 12:51:56 -0500, Stephen Leake wrote: > > >>"Luke A. Guest" writes: >> >> >>>So, my question is this; is this a bug in the compiler or am I missing >>>something? >> >>Try "pragma No_Run_Time" in your gnat.ads file. It says "don't >>generate _anything_ not directly required by my code", in effect. >> >> >>>I'm currently using GCC-3.3.2 with the FSF GNAT package. >> >>"pragma No_Run_Time" may not be supported by this version. Look in the >>gnat rm for similar pragmas; I think there is one to suppress the enum >>stuff. >> >>Note that No_Run_Time is not documented. > > > I have this in my gnat.adc (not gnat.ads) file: > > pragma No_Run_Time; > pragma Restrictions(No_Exceptions); > > This is in the GNAT RM from the GCC site: > > "pragma No_Run_Time > Syntax: > > pragma No_Run_Time; > > > This is a configuration pragma that makes sure the user code does not > use nor need anything from the GNAT run time. This is mostly useful in > context where code certification is required. Please consult the GNAT Pro > High-Integrity Edition User's Guide for additional information." > > >>>I can remove the redundant code by using the following GCC options >>>"-ffunction-sections -fdata-sections" and linker option "--gc-sections" >>>but this is a workaround rather than a solution. >> >>Well, GNAT is not normally used to build kernels, and kernels are >>_not_ like typical user programs. So I would not be surprised to need >>some extra compiler/linker options. I'd call that a "solution", if >>there is not a GNAT pragma that does what you need. > > > Although a kernel is not a *normal* program, Ada was designed to be > used in the embedded sector with or without an OS, so there must be a > solution as somebody must've needed to do what I'm wanting to do at some point. > > Thanks, > Luke. > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada >