From 7ac77ca9ac780a3b027e59d23433a5e1e027e93f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 2 Jun 2017 05:18:52 -0400 Subject: Revert "Revert "Clear Visual Studio warnings (Issue 412)"" This reverts commit c3871aec948013c1a4d5613050c659520f59e2e4. --- algparam.h | 8 +++++--- bench1.cpp | 8 ++++++++ bench2.cpp | 4 ++++ channels.cpp | 4 ++++ channels.h | 9 +++++++++ config.h | 4 ++++ cryptlib.h | 2 +- datatest.cpp | 4 ++-- dlltest.cpp | 4 ++++ ec2n.h | 9 +++++++++ eccrypto.h | 9 +++++++++ ecp.h | 9 +++++++++ filters.cpp | 2 +- filters.h | 2 +- gf2n.h | 9 +++++++++ gfpcrypt.h | 2 +- iterhash.h | 14 ++++++++++++++ modarith.h | 9 +++++++++ modes.h | 12 ++++++++++++ modexppc.h | 9 +++++++++ regtest1.cpp | 4 ++++ regtest2.cpp | 4 ++++ regtest3.cpp | 4 ++++ secblock.h | 4 ++-- strciphr.h | 2 +- validat0.cpp | 4 ++++ validat1.cpp | 4 ++++ validat2.cpp | 4 ++++ validat3.cpp | 4 ++++ 29 files changed, 155 insertions(+), 12 deletions(-) diff --git a/algparam.h b/algparam.h index aceaba4e..95399615 100644 --- a/algparam.h +++ b/algparam.h @@ -11,10 +11,12 @@ #include "config.h" #include "cryptlib.h" -// TODO: fix 6011 when the API/ABI can change -#if (CRYPTOPP_MSC_VERSION >= 1400) +#if CRYPTOPP_MSC_VERSION # pragma warning(push) -# pragma warning(disable: 6011 28193) +# pragma warning(disable: 4231 4275) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6011 6386 28193) +# endif #endif #include "smartptr.h" diff --git a/bench1.cpp b/bench1.cpp index 94173005..2d128648 100644 --- a/bench1.cpp +++ b/bench1.cpp @@ -16,6 +16,14 @@ #include "cpu.h" #include "drbg.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4355) +#endif + +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) diff --git a/bench2.cpp b/bench2.cpp index e0853c4a..3d07b2d0 100644 --- a/bench2.cpp +++ b/bench2.cpp @@ -30,6 +30,10 @@ #include "oids.h" #include "randpool.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) diff --git a/channels.cpp b/channels.cpp index 62419fdd..ec7a98a0 100644 --- a/channels.cpp +++ b/channels.cpp @@ -8,6 +8,10 @@ #include "cryptlib.h" #include "channels.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) #if 0 diff --git a/channels.h b/channels.h index deacca0d..9af4b461 100644 --- a/channels.h +++ b/channels.h @@ -12,6 +12,11 @@ #include "smartptr.h" #include "stdcpp.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) #if 0 @@ -131,4 +136,8 @@ private: NAMESPACE_END +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/config.h b/config.h index d21b0d4a..1dec8b4a 100644 --- a/config.h +++ b/config.h @@ -732,6 +732,8 @@ NAMESPACE_END #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL +#elif !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) +#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL #else #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL #endif @@ -746,6 +748,8 @@ NAMESPACE_END #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class +#elif !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) +#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class #else #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class #endif diff --git a/cryptlib.h b/cryptlib.h index f2c04267..b855784d 100644 --- a/cryptlib.h +++ b/cryptlib.h @@ -99,7 +99,7 @@ and getting us started on the manual. #if CRYPTOPP_MSC_VERSION # pragma warning(push) -# pragma warning(disable: 4127 4189 4702) +# pragma warning(disable: 4127 4189 4505 4702) #endif NAMESPACE_BEGIN(CryptoPP) diff --git a/datatest.cpp b/datatest.cpp index 805fcd03..2f9bcb5f 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -25,8 +25,8 @@ # pragma strict_gs_check (on) #endif -#if defined(__COVERITY__) -extern "C" void __coverity_tainted_data_sanitize__(void *); +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) #endif NAMESPACE_BEGIN(CryptoPP) diff --git a/dlltest.cpp b/dlltest.cpp index 27def6f0..102fd7d0 100644 --- a/dlltest.cpp +++ b/dlltest.cpp @@ -6,6 +6,10 @@ #include "cryptlib.h" #include "filters.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + USING_NAMESPACE(CryptoPP) USING_NAMESPACE(std) diff --git a/ec2n.h b/ec2n.h index 1d4c9824..cc4c0462 100644 --- a/ec2n.h +++ b/ec2n.h @@ -17,6 +17,11 @@ #include "smartptr.h" #include "pubkey.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +#endif + NAMESPACE_BEGIN(CryptoPP) //! \class EC2N @@ -123,4 +128,8 @@ private: NAMESPACE_END +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/eccrypto.h b/eccrypto.h index 2a1836c2..a4bf3e75 100644 --- a/eccrypto.h +++ b/eccrypto.h @@ -22,6 +22,11 @@ #include "ecp.h" #include "ec2n.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +#endif + NAMESPACE_BEGIN(CryptoPP) //! \brief Elliptic Curve Parameters @@ -665,4 +670,8 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +#endif + NAMESPACE_BEGIN(CryptoPP) //! \brief Polynomial with Coefficients in GF(2) @@ -375,4 +380,8 @@ template<> inline void swap(CryptoPP::PolynomialMod2 &a, CryptoPP::PolynomialMod NAMESPACE_END #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/gfpcrypt.h b/gfpcrypt.h index 974886fa..5addf8ed 100644 --- a/gfpcrypt.h +++ b/gfpcrypt.h @@ -12,7 +12,7 @@ #if CRYPTOPP_MSC_VERSION # pragma warning(push) -# pragma warning(disable: 4189) +# pragma warning(disable: 4189 4231 4275) #endif #include "cryptlib.h" diff --git a/iterhash.h b/iterhash.h index bdfa05ab..1b3e7cb5 100644 --- a/iterhash.h +++ b/iterhash.h @@ -1,3 +1,5 @@ +// strciphr.h - originally written and placed in the public domain by Wei Dai + #ifndef CRYPTOPP_ITERHASH_H #define CRYPTOPP_ITERHASH_H @@ -6,6 +8,14 @@ #include "misc.h" #include "simple.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6011 6386 28193) +# endif +#endif + NAMESPACE_BEGIN(CryptoPP) //! \class HashInputTooLong @@ -179,4 +189,8 @@ protected: NAMESPACE_END +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/modarith.h b/modarith.h index 5fff4275..1a78f535 100644 --- a/modarith.h +++ b/modarith.h @@ -14,6 +14,11 @@ #include "secblock.h" #include "misc.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +#endif + NAMESPACE_BEGIN(CryptoPP) CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup; @@ -313,4 +318,8 @@ private: NAMESPACE_END +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/modes.h b/modes.h index 0955c3bd..05be7b52 100644 --- a/modes.h +++ b/modes.h @@ -20,6 +20,14 @@ # pragma GCC diagnostic ignored "-Wsign-conversion" #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +# if (CRYPTOPP_MSC_VERSION >= 1400) +# pragma warning(disable: 6011 6386 28193) +# endif +#endif + NAMESPACE_BEGIN(CryptoPP) //! \class CipherModeDocumentation @@ -475,6 +483,10 @@ struct CBC_CTS_Mode_ExternalCipher : public CipherModeDocumentation NAMESPACE_END // Issue 340 +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE # pragma GCC diagnostic pop #endif diff --git a/modexppc.h b/modexppc.h index c2978871..5e8dd676 100644 --- a/modexppc.h +++ b/modexppc.h @@ -9,6 +9,11 @@ #include "smartptr.h" #include "pubkey.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(push) +# pragma warning(disable: 4231 4275) +#endif + NAMESPACE_BEGIN(CryptoPP) CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; @@ -36,4 +41,8 @@ private: NAMESPACE_END +#if CRYPTOPP_MSC_VERSION +# pragma warning(pop) +#endif + #endif diff --git a/regtest1.cpp b/regtest1.cpp index c4eb7380..86780e69 100644 --- a/regtest1.cpp +++ b/regtest1.cpp @@ -34,6 +34,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + USING_NAMESPACE(CryptoPP) // Unkeyed ciphers diff --git a/regtest2.cpp b/regtest2.cpp index d7a1d58c..8779c113 100644 --- a/regtest2.cpp +++ b/regtest2.cpp @@ -61,6 +61,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + USING_NAMESPACE(CryptoPP) // Shared key ciphers diff --git a/regtest3.cpp b/regtest3.cpp index 292bd544..7949c846 100644 --- a/regtest3.cpp +++ b/regtest3.cpp @@ -26,6 +26,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + USING_NAMESPACE(CryptoPP) void RegisterFactories3() diff --git a/secblock.h b/secblock.h index 73706897..8f5aa71a 100644 --- a/secblock.h +++ b/secblock.h @@ -12,9 +12,9 @@ #if CRYPTOPP_MSC_VERSION # pragma warning(push) -# pragma warning(disable: 4700) +# pragma warning(disable: 4231 4275 4700) # if (CRYPTOPP_MSC_VERSION >= 1400) -# pragma warning(disable: 6386) +# pragma warning(disable: 6011 6386 28193) # endif #endif diff --git a/strciphr.h b/strciphr.h index 83be614c..ff7cca67 100644 --- a/strciphr.h +++ b/strciphr.h @@ -32,7 +32,7 @@ #if CRYPTOPP_MSC_VERSION # pragma warning(push) -# pragma warning(disable: 4127 4189) +# pragma warning(disable: 4127 4189 4231 4275) #endif #include "cryptlib.h" diff --git a/validat0.cpp b/validat0.cpp index a0aa9e61..4b482c03 100644 --- a/validat0.cpp +++ b/validat0.cpp @@ -31,6 +31,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) diff --git a/validat1.cpp b/validat1.cpp index 50d6911d..c10efdf4 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -64,6 +64,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) diff --git a/validat2.cpp b/validat2.cpp index cc505edd..3d984e92 100644 --- a/validat2.cpp +++ b/validat2.cpp @@ -51,6 +51,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) diff --git a/validat3.cpp b/validat3.cpp index 829840b0..81257ec8 100644 --- a/validat3.cpp +++ b/validat3.cpp @@ -44,6 +44,10 @@ # pragma strict_gs_check (on) #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4505 4355) +#endif + NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) -- cgit v1.2.1