suppress MSVC code analysis (PREfast) warnings

Signed-off-by: Satoshi Tanda <tanda.sat@gmail.com>
test2
Satoshi Tanda 8 years ago
parent 777f0d30a6
commit 2df9a8eab7
  1. 3
      arch/AArch64/AArch64BaseInfo.c
  2. 4
      arch/Sparc/SparcInstPrinter.c
  3. 13
      arch/XCore/XCoreInstPrinter.c
  4. 3
      cs.c
  5. 2
      windows/winkernel_mm.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"

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -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, ' ');

@ -1,7 +1,8 @@
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 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 <libkern/libkern.h>

@ -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) {

Loading…
Cancel
Save