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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,34872f3f22b5b140 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 07:44:41 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Suggestion for gnatstub User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Sat, 9 Nov 2002 15:44:14 GMT Content-Type: text/plain; charset=us-ascii References: <3dcb9e51$0$303$bed64819@news.gradwell.net> <3DCBC4C9.AD436CD9@earthlink.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30654 Date: 2002-11-09T15:44:14+00:00 List-Id: Simon Wright writes: > My ColdFrame framework generator goes to a lot of trouble to generate > compilable subprograms that raise Program_Error if executed. I think > there is one case where this doesn't work (functions returning a value > of an imported type, eg GNAT.Socket_Type, that turns out to be > private). Presuming the goal is to get the code to compile, but not run, you could generate: function F(X, Y: Integer) return GNAT.Socket_Type is begin raise Program_Error; return F(X, Y); -- bogus return to keep compiler from griping end F; Actually, I suspect the compiler might gripe about infinite recursion, so maybe you need this: function F(X, Y: Integer) return GNAT.Socket_Type is begin raise Program_Error; pragma Warnings(Off); return F(X, Y); -- bogus return to keep compiler from griping pragma Warnings(On); end F; Bleah. It's pretty annoying that Ada requires a return statement on paths that *obviously* raise exceptions. - Bob