From 4b07ef52d5d8ce49abda6b13a1b3015c1a512064 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Mon, 20 Feb 2017 14:14:11 -0500 Subject: [PATCH] Fixes for Windows warnings --- CMakeLists.txt | 1 + include/CLI/App.hpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc6e14b8..b8d4f569 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ if(CMAKE_COMPILER_IS_GNUCC) endif() if(MSVC) add_definitions("/W4") + add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() add_library(CLI INTERFACE) diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 5e4d510e..c8c0ca91 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -519,9 +519,9 @@ public: } /// Check with name instead of pointer - bool got_subcommand(std::string name) const { + bool got_subcommand(std::string name_) const { for(const auto subcomptr : selected_subcommands) - if(subcomptr->check_name(name)) + if(subcomptr->check_name(name_)) return true; return false; } @@ -630,7 +630,7 @@ protected: // Collect positionals // Loop over all positionals - for(int i=0; i