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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Fun with trampolines Date: Fri, 16 Mar 2018 18:05:13 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="baebf2bbe04253dca3258e26aa150792"; logging-data="21929"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19S9yrTsy2ELZH/pqnUZzEPUSEecrTTdoM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:+tDD4VdiaH6WOl+3dQgCmeMVO4Q= sha1:V0LWXQH2t6adTCN9erL30LqDhD8= Xref: reader02.eternal-september.org comp.lang.ada:51035 Date: 2018-03-16T18:05:13+00:00 List-Id: alby.gamper@gmail.com writes: > On Thursday, March 15, 2018 at 5:03:28 AM UTC+11, Simon Wright wrote: >> Some of you might be entertained by my recent encounter with trampolines >> for Tcl/Tk callbacks. Always tiresome when you visit demo code after a >> few years and it doesn't work any more. >> >> There's at least a chance that the trampoline (which exists on the >> stack) might have been trampled on, though I didn't think so when I >> checked it. The question has to be, _which_ stack is it on? I suppose it >> has to be that of the code that's executing when 'Access is taken. >> >> https://forward-in-code.blogspot.co.uk/2018/03/tcltk-vs-trampolines.html > > Dear Simon > > I seem to recall that GCC/GNAT recently (ie 7.1 or 7.2) removed support for > trampolines ? Could this have an effect on your legacy code ? > > Alex Hi Alex, I assume you mean FSF GCC 7.1.0, 7.2.0 rather than the similarly-numbered GNAT Pro releases? I don't think it's so much that they've removed support for trampolines as that they've worked out how to avoid using them! (FSF GCC 8.0.1 still generates them when it finds it necessary, i.e. some combination of nested & Convention => not-Ada). Thinking about it, since the trampoline is on the stack it's very dangerous to pass it to an external library for that library to call it much later! My only excuse is that it used to work ...