From d31bbd6d1495f1f1a88d163ace435516bf62d3ae Mon Sep 17 00:00:00 2001 From: MerryMage Date: Fri, 5 Aug 2016 18:42:26 +0100 Subject: [PATCH] Common/x64/CpuDetect: Disable MSVC warning for strncpy --- src/common/x64/cpu_detect.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index a1fe8b16..2ff21cd7 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -81,8 +81,18 @@ static CPUCaps Detect() { else caps.vendor = CPUVendor::OTHER; +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +#endif + // Set reasonable default brand string even if brand string not available strncpy(caps.cpu_string, caps.brand_string, sizeof(caps.cpu_string)); + caps.cpu_string[sizeof(caps.cpu_string) - 1] = '\0'; + +#ifdef _MSC_VER +#pragma warning(pop) +#endif // Detect family and other miscellaneous features if (max_std_fn >= 1) {