comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Convert between C "void*" pointer and an access
Date: Thu, 12 Oct 2017 00:52:15 +0300
Date: 2017-10-12T00:52:15+03:00	[thread overview]
Message-ID: <orm3qe$1r0c$1@gioia.aioe.org> (raw)

What is the right way to convert between C "void*" pointer and an access to 
a tagged or class-wide type?

Ada.Unchecked_Conversion seems to be what I need, but the access type may be 
"fat" and thus have another format than void*.

I caught myself doing such unchecked conversions, but now I feel I did an 
error.

For example, let

type X_Type is abstract tagged null record;

How to store X_Type'Class pointer in "void*" and convert them back and 
forth?

-- 
Victor Porton - http://portonvictor.org


             reply	other threads:[~2017-10-11 21:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 21:52 Victor Porton [this message]
2017-10-11 22:32 ` Convert between C "void*" pointer and an access Randy Brukardt
2017-10-11 23:03   ` Victor Porton
2017-10-12  7:57     ` Dmitry A. Kazakov
2017-10-12  8:05     ` Simon Wright
2017-10-29 14:50   ` David Thompson
2017-10-11 22:58 ` Victor Porton
2017-10-11 23:12   ` Victor Porton
2017-10-12  1:01     ` Victor Porton
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox