On Mon, Nov 22, 2004, J.T. Conklin wrote:

> The TAO SSLIOP implementation uses openssl, but does not compile with
> some C++ compilers (including current versions of g++) due to what
> appears to be problems with the DSAparams_dup() and DHparams_dup()
> macros.  
> 
> This bit of code is similar to that in TAO's SSLIOP_EVP_PKEY.cpp.  It
> compiles fine with gcc, but fails with with g++.  I'm using gcc 3.3.3
> and openssl 0.9.7d as distributed with NetBSD 2.0RC4 and gcc 3.3 and
> openssl 0.9.7b as distributed with MacOSX 10.3.6 "Panther".  I've also
> reproduced the same problem with gcc 3.4.2.
> 
> Compiling this code:
>     #include <openssl/asn1.h>
>     #include <openssl/dsa.h>
>     #include <openssl/dh.h>
> 
> 
>     DSA *
>     duplicate_dsa(DSA *dsa)
>     {
>             return DSAparams_dup (dsa);
>     }
> 
>     DH *
>     duplicate_dh(DH *dh)
>     {
>             return DHparams_dup (dh);
>     }
> 
> Yields:
>     $ g++ -O2 -c ssl.cc 
>     ssl.cc: In function `DSA* duplicate_dsa(DSA*)':
>     ssl.cc:9: error: invalid conversion from `int (*)()' to `int (*)(...)'
>     ssl.cc:9: error: invalid conversion from `char*(*)()' to `char*(*)(...)'
>     ssl.cc: In function `DH* duplicate_dh(DH*)':
>     ssl.cc:15: error: invalid conversion from `int (*)()' to `int (*)(...)'
>     ssl.cc:15: error: invalid conversion from `char*(*)()' to `char*(*)(...)'
> 
> I'm not quite sure whether it's TAO, g++, or openssl that's at fault,
> but I'd appreciate any pointers.
> 

The problem is that *_dup() are all macros and there's a conflict between the
C definition of func() (undefined parameters) and the C++ version (no
parameters).

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to