Thanks, I've checked in your suggested change as r531.

-----Original Message----- From: Marshall Clow
Sent: Monday, October 10, 2011 4:25 PM
To: Crypto++ Users
Subject: Eliminating warning

When compiling the test suite for crypto++ 5.6.1 using LLVM, I got a whole bunch of warnings that looked like this:

In file included from regtest.cpp:1:
./factory.h:45:4: warning: delete called on 'ObjectFactory<CryptoPP::PK_Encryptor>' that is abstract
      but has non-virtual destructor [-Wdelete-non-virtual-dtor]
                        delete (ObjectFactory<AbstractClass> *)i->second;
                        ^
./factory.h:91:56: note: in instantiation of member function
'CryptoPP::ObjectFactoryRegistry<CryptoPP::PK_Encryptor, 0>::~ObjectFactoryRegistry' requested
      here
        static ObjectFactoryRegistry<AbstractClass, instance> s_registry;
                                                              ^
./factory.h:101:50: note: in instantiation of member function
'CryptoPP::ObjectFactoryRegistry<CryptoPP::PK_Encryptor, 0>::Registry' requested here
        ObjectFactoryRegistry<AbstractClass, instance>::Registry().
                                                        ^
./factory.h:108:2: note: in instantiation of member function
      'CryptoPP::RegisterDefaultFactoryFor<CryptoPP::PK_Encryptor,

CryptoPP::PK_FinalTemplate<CryptoPP::TF_EncryptorImpl<CryptoPP::TF_CryptoSchemeOptions<CryptoPP::TF_ES<CryptoPP::OAEP<SHA>,
CryptoPP::RSA, int>, CryptoPP::RSA, CryptoPP::OAEP<SHA> > > >, 0>::RegisterDefaultFactoryFor'
      requested here
RegisterDefaultFactoryFor<PK_Encryptor, CPP_TYPENAME SchemeClass::Encryptor>((const ...
        ^
regtest.cpp:91:2: note: in instantiation of function template specialization

'CryptoPP::RegisterAsymmetricCipherDefaultFactories<CryptoPP::RSAES<CryptoPP::OAEP<SHA> > >'
      requested here
RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
        ^
In file included from regtest.cpp:1:
./factory.h:45:4: warning: delete called on 'ObjectFactory<CryptoPP::PK_Decryptor>' that is abstract
      but has non-virtual destructor [-Wdelete-non-virtual-dtor]
                        delete (ObjectFactory<AbstractClass> *)i->second;
                        ^

Adding the line:
virtual ~ObjectFactory () {}

to factory.h both:
* Silenced the warning
* Left the test results unchanged

-- Marshall

Marshall Clow     Idio Software   <mailto:[email protected]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
       -- Yu Suzuki

--
You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
--
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to