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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Least Dangerous Way to Do This ? Date: Mon, 15 Oct 2018 15:36:25 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 15 Oct 2018 20:36:26 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="19612"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:54601 Date: 2018-10-15T15:36:25-05:00 List-Id: wrote in message news:beac86f1-fa15-4719-bfc3-8d0334260906@googlegroups.com... > Hi Everyone > > Okay, don't laugh(or laugh too hard) > > I need to interface with automatically generated C. function pointers are > represented as a pointer to a pointer to a char. This is weird but done > for pointer arithmetic purposes. It's not certain (in the real world, at least) if a function pointer and an object pointer have the same representation. We treat them as completely different things in our code generator, because some weird machines (in particular the U2200) have very large representations for function pointers (one version was 8 36-bit words!). Similarly, on the 16-bit 8086 compilers, function pointers carried a segment (thus a 32-bit address), and object pointers usually didn't (thus a 16-bit address). So if you want this code to work in different environments, I'd try to avoid mixing the two (as Simon suggested). Randy.