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 12:08:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Suggestion for gnatstub Date: 09 Nov 2002 20:08:43 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3dcb9e51$0$303$bed64819@news.gradwell.net> <3DCBC4C9.AD436CD9@earthlink.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1036872518 8339 62.49.19.209 (9 Nov 2002 20:08:38 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 9 Nov 2002 20:08:38 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:30668 Date: 2002-11-09T20:08:43+00:00 List-Id: Robert A Duff writes: > 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. I had thought about function F(X, Y: Integer) return GNAT.Socket_Type is Dummy : GNAT.Socket_Type; pragma Warnings (Off, Dummy); begin raise Program_Error; return Dummy; end F;