diff --git a/arch/AArch64/AArch64BaseInfo.c b/arch/AArch64/AArch64BaseInfo.c index 26eb786a..5afb9249 100644 --- a/arch/AArch64/AArch64BaseInfo.c +++ b/arch/AArch64/AArch64BaseInfo.c @@ -17,7 +17,8 @@ #ifdef CAPSTONE_HAS_ARM64 #if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64) -#pragma warning(disable:4996) +#pragma warning(disable:4996) // disable MSVC's warning on strcpy() +#pragma warning(disable:28719) // disable MSVC's warning on strcpy() #endif #include "../../utils.h" diff --git a/arch/Sparc/SparcInstPrinter.c b/arch/Sparc/SparcInstPrinter.c index c5f1e2c2..ff92c04f 100644 --- a/arch/Sparc/SparcInstPrinter.c +++ b/arch/Sparc/SparcInstPrinter.c @@ -20,6 +20,10 @@ #define _CRT_SECURE_NO_WARNINGS #endif +#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64) +#pragma warning(disable:28719) // disable MSVC's warning on strncpy() +#endif + #include #include #include diff --git a/arch/XCore/XCoreInstPrinter.c b/arch/XCore/XCoreInstPrinter.c index c050c581..c9aec945 100644 --- a/arch/XCore/XCoreInstPrinter.c +++ b/arch/XCore/XCoreInstPrinter.c @@ -16,6 +16,11 @@ #ifdef CAPSTONE_HAS_XCORE +#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64) +#pragma warning(disable : 4996) // disable MSVC's warning on strcpy() +#pragma warning(disable : 28719) // disable MSVC's warning on strcpy() +#endif + #include #include #include @@ -46,15 +51,7 @@ void XCore_insn_extract(MCInst *MI, const char *code) char *p, *p2; char tmp[128]; -// make MSVC shut up on strcpy() -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -#endif strcpy(tmp, code); // safe because code is way shorter than 128 bytes -#ifdef _MSC_VER -#pragma warning(pop) -#endif // find the first space p = strchr(tmp, ' '); diff --git a/cs.c b/cs.c index c3becd8c..30839051 100644 --- a/cs.c +++ b/cs.c @@ -1,7 +1,8 @@ /* Capstone Disassembly Engine */ /* By Nguyen Anh Quynh , 2013-2015 */ #if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64) -#pragma warning(disable:4996) +#pragma warning(disable:4996) // disable MSVC's warning on strcpy() +#pragma warning(disable:28719) // disable MSVC's warning on strcpy() #endif #if defined(CAPSTONE_HAS_OSXKERNEL) #include diff --git a/windows/winkernel_mm.c b/windows/winkernel_mm.c index 6052be28..c127da3a 100644 --- a/windows/winkernel_mm.c +++ b/windows/winkernel_mm.c @@ -31,6 +31,8 @@ void * CAPSTONE_API cs_winkernel_malloc(size_t size) // in many cases, indicate a potential validation issue in the calling code. NT_ASSERT(size); + // FP; a use of NonPagedPool is required for Windows 7 support +#pragma prefast(suppress : 30030) // Allocating executable POOL_TYPE memory CS_WINKERNEL_MEMBLOCK *block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag( NonPagedPool, size + sizeof(CS_WINKERNEL_MEMBLOCK), CS_WINKERNEL_POOL_TAG); if (!block) {