Ben Laurie wrote:
> 
> Richard Levitte - VMS Whacker wrote:
> > The easiest way to avoid the conversions noted above is to have a
> > union like this:
> >
> >         union foo {
> >                 void *simple;
> >                 int (*fn)();
> >         };
> >
> > and use it internally.  You put whatever char * you want to convert to
> > a functino pointer into simple and pull out the function pointer from
> > fn, and vice versa.
> 
> That assumes that the conversion the compiler is attempting to prevent
> can actually be done, which is not, of course, a valid assumption. The
> only way to do this validly is to make the functions actually take a foo
> * as their argument, surely? And yes, then you may end up with a memory
> management problem (though often not, coz I'll bet in most cases you can
> make the foo static).
> 

Hmmm. Do we have to use this on every platform, including those that
handled it before?

Can't we just have a macro or function that does the conversion? I.e. on
most platforms it would be a macro which expands to a cast but on VMS it
would end up calling a function.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to