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,2d1a49d186e069b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-28 10:14:40 PST Path: news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: setjmp/longjmp? Date: 28 Sep 2003 18:12:52 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1064769279 8413 62.49.19.209 (28 Sep 2003 17:14:39 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 28 Sep 2003 17:14:39 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: news1.google.com comp.lang.ada:76 Date: 2003-09-28T18:12:52+01:00 List-Id: chris writes: > I started a binding to libpng so I can load some images into OpenGL, > but the library uses setjmp and longjmp for error handling. This is > very new to me but from what I understand it's some form of library > "goto" which allows code to jump to predefined points on given > events. When dealing with such things is it best to wrap around the > code with C and catch all these longjmps with setjmps, returning > error flags if something fails? setjmp/longjmp are like a block to catch an exception, and raising that exception. I would do as you suggest - your chance of setting up a jmpbuf in Ada is close to zero.