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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23ade4b42d9cb5f0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-20 10:46:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Martin Krischik" Newsgroups: comp.lang.ada Subject: Re: Eliminating copying in Gnat Date: Mon, 20 Jan 2003 19:34:10 +0100 Organization: never organized Message-ID: <2ffh0b-tc5.ln@linux1.krischik.com> References: <3e2b7777$0$33930$bed64819@news.gradwell.net> <3E2C0E44.481AC15B@dassault-aviation.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 X-Trace: news.t-online.com 1043088314 03 2541 tiKYEtnSCAU5b 030120 18:45:14 X-Complaints-To: abuse@t-online.com X-Sender: 05341395658-0001@t-dialin.net User-Agent: Pan/0.13.0 (The whole remains beautiful) Xref: archiver1.google.com comp.lang.ada:33246 Date: 2003-01-20T19:34:10+01:00 List-Id: On Mon, 20 Jan 2003 15:57:08 +0100, Damien CARBONNE wrote: > Victor Porton wrote: >> Is it possible to cause Gnat to not do unnecessary copying >> when calling this fynction? >> >> function Pass(X: T) return T is >> pragma Inline(Pass); >> begin >> return X; >> end; Funny as you say, I did the very same thing today and the compiler actualy told me in no uncertain terms that it did not like it. But then I am a masochist with all warnings swiched on. > I'm not completely sure about it, but I would not put the "pragma > Inline" at this place, but rather in the spec file (.ads). > > package XXX is > function Pass(X:T) return T; > pragma Inline(Pass); > end XXX; I think you are right. The compiler liked that Version much more. With Regards Martin. PS: The Compiler used was GNAT for OS/2. -- Martin Krischik mailto://Martin@krischik.com http://www.krischik.com