From 424cf80f8bf0ae5d139215dc28bd76ba58d3371d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 26 Aug 2016 14:43:14 -0400 Subject: [PATCH] Disable C4996 (secure CRT) recommendation on Windows for strtok(). strtok_s() is suggested by MSVC, but it has different signature than the C11 standard one. So we just turn off the recommendation here. --- StandAlone/ResourceLimits.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp index 80198634..8a5e6f37 100644 --- a/StandAlone/ResourceLimits.cpp +++ b/StandAlone/ResourceLimits.cpp @@ -241,8 +241,10 @@ std::string GetDefaultTBuiltInResourceString() void DecodeResourceLimits(TBuiltInResource* resources, char* config) { const char* delims = " \t\n\r"; +#pragma warning(suppress: 4996) const char* token = strtok(config, delims); while (token) { +#pragma warning(suppress: 4996) const char* valueStr = strtok(0, delims); if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) { printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : ""); @@ -438,6 +440,7 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config) else printf("Warning: unrecognized limit (%s) in configuration file.\n", token); +#pragma warning(suppress: 4996) token = strtok(0, delims); } }