Removed MSVC warning suppression for many warnings (Issue 412)

Most of these appear to have been cleared over the last couple of years.

C4127 is too prevelant. We are probably going to have to live with it.

We may be able to clear C4250 with a using statement. For example 'using ASN1CryptoMaterial::Load'.

MSVC resisted clearing C4661 by pushing/poping in iterhash.h and osrng.h. It was like MSVC simply ignored it.
This commit is contained in:
Jeffrey Walton 2017-05-16 03:52:03 -04:00
parent b083390d4f
commit 5f0cbde980
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 5 additions and 13 deletions

View File

@ -354,7 +354,7 @@ NAMESPACE_END
// 4786: identifier was truncated in debug information
// 4355: 'this' : used in base member initializer list
// 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
# pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910)
# pragma warning(disable: 4127 4512 4661)
// Security related, possible defects
// http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx
# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928)

14
dll.cpp
View File

@ -5,15 +5,10 @@
#include "dll.h"
#include "config.h"
#include "iterhash.h"
// TODO: fix the C4589 warnings
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4589)
#endif
#if CRYPTOPP_MSC_VERSION
# pragma warning(default: 4660)
#endif
// Cast from FARPROC to funcptr with args, http://stackoverflow.com/q/4192058/608639
#pragma warning(disable: 4191)
#if defined(CRYPTOPP_EXPORTS) && defined(CRYPTOPP_WIN32_AVAILABLE)
#include <windows.h>
@ -70,9 +65,6 @@ static void * New (size_t size)
return p;
}
// Cast from FARPROC to funcptr with args, http://stackoverflow.com/q/4192058/608639
#pragma warning(disable: 4191)
static void SetNewAndDeleteFunctionPointers()
{
void *p = NULLPTR;

View File

@ -182,7 +182,7 @@ private:
#endif
// Safer functions on Windows for C&A, https://github.com/weidai11/cryptopp/issues/55
static std::string TimeToString(const time_t& t)
inline std::string TimeToString(const time_t& t)
{
#if (CRYPTOPP_MSC_VERSION >= 1400)
tm localTime = {};