Re: Re: HToolkit binary compatibility

Marcin 'Qrczak' Kowalczyk <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
Dnia nie 10. sierpnia 2003 23:45, Wolfgang Jeltsch napisał:

> If void * was realized such that function pointers
> as well as data pointers could be safely cast to void * and back²)

Function pointers are not required to fit in void *. In particular I believe 
that DOS compilers you mention had void * of the size of data pointers.

Function pointers can be freely cast between other function pointer types.
They must only be cast back to the correct type before using. So any function 
pointer type can be used for generic function pointers - with explicit casts 
though, unlike void * for data pointers.

> ¹) This assumes that the stack, the global data and the heap all resided in
> the data segment. I'm not completely sure if this was the case in the small
> model.

It was; otherwise data pointers couldn't be 16 bit and we would gain nothing.

-- 
   __("<         Marcin Kowalczyk
   \__/       [email protected]
    ^^     http://qrnik.knm.org.pl/~qrczak/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.