Re: Garnome 2.13.3 on a Debian unstable distribution : errors in pwlib



Olivier,

Your compiler is being "strict", which is not really a bad thing.

From your preprocessor output

   typedef unsigned char BYTE;

What the compiler is complaining about in this case is:

   PSSLPrivateKey::PSSLPrivateKey(const BYTE * keyData, PINDEX keySize)
   {
     key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyData, keySize);
   }


   PSSLPrivateKey::PSSLPrivateKey(const PBYTEArray & keyData)
   {
     const BYTE * keyPtr = keyData;
     key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyPtr, keyData.GetSize());
   }


Here is something to try:

   replace (BYTE**)  => (const BYTE**)


The other compiler complaints are similar:

   PSSLCertificate::PSSLCertificate(const BYTE * certData, PINDEX certSize)
   {
     certificate = d2i_X509(NULL, (unsigned char **)&certData, certSize);
   }


   PSSLCertificate::PSSLCertificate(const PBYTEArray & certData)
   {
     const BYTE * certPtr = certData;
     certificate = d2i_X509(NULL, (unsigned char **)&certPtr,
   certData.GetSize());
   }


   PSSLCertificate::PSSLCertificate(const PString & certStr)
   {
     PBYTEArray certData;
     PBase64::Decode(certStr, certData);
     if (certData.GetSize() > 0) {
       const BYTE * certPtr = certData;
       certificate = d2i_X509(NULL, (unsigned char **)&certPtr,
   certData.GetSize());
     }
     else
       certificate = NULL;
   }

try:

   replace:  (unsigned char **) ==> (const unsigned char **)

-Joseph

====================================================================

Olivier Lecarme wrote:
What version of gcc (g++) are you using? The GNU folks have been
enforcing coding standards as of late.
Olivier,

b% g++ --version
g++ (GCC) 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)

You need to track down where the definition of BYTE is coming from. If
you know how to use compiler flags like '-E' that would be a place to
start.

I built the preprocessor result of the faulty module ptclib/pssl.cxx,
but it's too long to be included here. I put it on the following link:

		http://olecarme.homelinux.net/pssl.cxx2


--
joseph_sacco [at] comcast [dot] net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]