Hi

I mailed this question yesterday to the users mailing list, but it 
seems that this list is more appropriate for this issue.

I wanted to use the STACK functions with 
DECLARE/IMPLEMENT_STACK_OF(ClassXYZ) and got some 
compiler errors (listed below) caused by the data type check of the 
C++ compiler.

Casting the *problemetic* arguments, eliminated the compiler 
errors.

  { return (STACK_OF(type) *)sk_new((int (*)())cmp); } \ 


Questions:

1. Is there a way to eliminate the C++ compiler from performing the 
data type check or is there a way I could eliminate this failure  
within my code?

2. If not would it be possible to add such a casting?

3. There are a few such functions in OpenSSL which are  declared 
and implemented differently (e.g., BIO_METHODS  declarations vs. 
mem_method or file_method ). What is the reason  it's done this 
way? 


Help would be very appreciate

Dror



e:\my.cpp(20) : error C2664: 'sk_new' : cannot convert parameter 1 
from 'int (__cdecl *)(class ClassXYZ** ,class ClassXYZ ** )' to 'int 
(__cdecl *)(void)'
        This conversion requires a reinterpret_cast, a C-style cast or 
function-style cast
e:\my.cpp(20) : error C2664: 'sk_set_cmp_func' : cannot convert 
parameter 2 from 'int (__cdecl *)(class ClassXYZ** ,class ClassXYZ 
** )' to 'int (__cdecl *)(void)'
        This conversion requires a reinterpret_cast, a C-style cast or 
function-style cast
e:\my.cpp(20) : error C2664: 'sk_pop_free' : cannot convert 
parameter 2 from 'void (__cdecl *)(class ClassXYZ *)' to 'void 
(__cdecl *)(void)'
        This conversion requires a reinterpret_cast, a C-style cast or 
function-style cast

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

Reply via email to