From 425254aba513b48766aedf1e5edeb071ccff34a9 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 21 Jul 2017 22:45:42 +0300 Subject: [PATCH] mdbx-tools: hush MSVC's internal warnings. Change-Id: I2b2bdb149149aa8bafff0bb7df205547f645fe10 --- libmdbx.files | 2 ++ src/tools/wingetopt.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libmdbx.files b/libmdbx.files index b6b1d7a2..153bfe32 100644 --- a/libmdbx.files +++ b/libmdbx.files @@ -20,6 +20,8 @@ src/tools/mdbx_load.1 src/tools/mdbx_load.c src/tools/mdbx_stat.1 src/tools/mdbx_stat.c +src/tools/wingetopt.c +src/tools/wingetopt.h src/version.c test/actor.cc test/base.h diff --git a/src/tools/wingetopt.c b/src/tools/wingetopt.c index 8059e5d9..1dd0d069 100644 --- a/src/tools/wingetopt.c +++ b/src/tools/wingetopt.c @@ -6,10 +6,32 @@ * Code given out at the 1985 UNIFORUM conference in Dallas. */ +/*----------------------------------------------------------------------------*/ +/* Microsoft compiler generates a lot of warning for self includes... */ + +#ifdef _MSC_VER +#pragma warning(push, 1) +#pragma warning(disable : 4548) /* expression before comma has no effect; \ + expected expression with side - effect */ +#pragma warning(disable : 4530) /* C++ exception handler used, but unwind \ + * semantics are not enabled. Specify /EHsc */ +#pragma warning(disable : 4577) /* 'noexcept' used with no exception handling \ + * mode specified; termination on exception is \ + * not guaranteed. Specify /EHsc */ +#if !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS +#endif +#endif /* _MSC_VER (warnings) */ + #include "wingetopt.h" #include #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif +/*----------------------------------------------------------------------------*/ + #ifndef NULL #define NULL 0 #endif