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: Least Dangerous Way to Do This ? Date: Mon, 15 Oct 2018 17:05:33 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="da8580838aa05a08cfb2548df7377043"; logging-data="24457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JMHSV0yvaFZ+8/7q9pD6RCnh3ZH86OM0=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:k5YZkvPJFPqc7jnHR6WxwzZgoyA= sha1:vaVsHUarZKFxSsJrdaw67gZBHoE= Xref: reader02.eternal-september.org comp.lang.ada:54592 Date: 2018-10-15T17:05:33+01:00 List-Id: patrick@spellingbeewinnars.org writes: > 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. But it's not really a char**, is it! procedure Pointers is type Procedure_P is access procedure with Convention => C; type Procedure_P_P is access Procedure_P; P : Procedure_P_P; procedure Proc is null with Convention => C; begin P.all := Proc'Access; end Pointers; You could try something involving Proc'Address, though it's not obvious that that's mandated to be the address of something that you could call. Maybe convention C does that.