On Mon, Jan 17, 2000 at 01:06:27AM +0100, Richard Levitte - VMS Whacker wrote:

> DEC C for VMS is getting really mean.  Version 6.2 (latest, as far as
> I know) spews out a message when a (char *) cast is done to a function
> pointer and vice versa.

Every compiler should print such warnings, such casts are by no means
guaranteed to work.

> It's especially visible in all the places where lh_doall_arg() gets a
> casted function pointer as last argument (for example, see
> CRYPTO_mem_leaks_cb() in crypto/mem_dbg.c)...
> 
> I can imagine using silly things like a struct around the function
> pointer to get rid of that warning.

The function pointer *must* be inside a data object to make such constructs
legal, so this is not silly at all.  An alternative would be to use
unions of a function pointer and a data pointer (casts between
different function pointer types are legal, you just have to make
sure that you call the function as the same type as it was originally
defined -- OpenSSL even fails at this) instead of just a void *,
but that's probably more complicated than depositing the function pointer
in a struct.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to