comp.lang.ada
 help / color / mirror / Atom feed
* Convert between C "void*" pointer and an access
@ 2017-10-11 21:52 Victor Porton
  2017-10-11 22:32 ` Randy Brukardt
  2017-10-11 22:58 ` Victor Porton
  0 siblings, 2 replies; 9+ messages in thread
From: Victor Porton @ 2017-10-11 21:52 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-29 14:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-11 21:52 Convert between C "void*" pointer and an access Victor Porton
2017-10-11 22:32 ` 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

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