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-Thread: 103376,e5a3abec221df39 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Possible compiler bug with this simple program Date: Thu, 04 Sep 2008 21:49:56 +0100 Organization: Pushface Message-ID: References: <1edc3682-855f-405b-8348-72b423377b1a@i20g2000prf.googlegroups.com> <48b65b3b$0$25384$4f793bc4@news.tdc.fi> <97b1150b-cb8f-4972-b594-2ae59af84147@x16g2000prn.googlegroups.com> <8c8e5e62-16e1-4442-a6e9-f4e63fbed7a8@a8g2000prf.googlegroups.com> <903354c9-7780-4843-a5a3-dd2c40903d40@p31g2000prf.googlegroups.com> <2da4989c-4c97-43e9-8102-ba99389fdea9@v16g2000prc.googlegroups.com> <0494a60a-a452-436b-86f9-844b398aab4f@b38g2000prf.googlegroups.com> <5ca524f3-0fde-4c3b-b1a0-fe2281180ef3@k36g2000pri.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1220561397 29908 62.49.19.209 (4 Sep 2008 20:49:57 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 4 Sep 2008 20:49:57 +0000 (UTC) Cancel-Lock: sha1:W0lKb02KwOfnBQ71+6pNMU65Jlc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) Xref: g2news2.google.com comp.lang.ada:7657 Date: 2008-09-04T21:49:56+01:00 List-Id: Jerry writes: > The difference between the two cases ([1] described above, herein, and > [2] the code in mixed Ada and C that I posted earlier), is that in > [1], both the called procedure and the callback procedure are written > in C, and the in problematic code [2], the called subprogram is in C > (plmap) but the callback (mapform19) is written in Ada, with C > conventions. Referring to [2], you also need to be careful (GNAT & VxWorks at least) if the C calling thread isn't an Ada task; the Ada code expects the VxWorks TCB to contain a pointer to auxiliary Ada RTS structures. Call GNAT.Threads.Register_Thread (as early as possible in the called Ada subprogram, I guess! before it needs the secondary stack, for example)