1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-08 15:53:51 +00:00

Fixes for Windows warnings

This commit is contained in:
Henry Fredrick Schreiner 2017-02-20 14:14:11 -05:00
parent e328364ae7
commit 4b07ef52d5
2 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif() endif()
if(MSVC) if(MSVC)
add_definitions("/W4") add_definitions("/W4")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif() endif()
add_library(CLI INTERFACE) add_library(CLI INTERFACE)

View File

@ -519,9 +519,9 @@ public:
} }
/// Check with name instead of pointer /// 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) for(const auto subcomptr : selected_subcommands)
if(subcomptr->check_name(name)) if(subcomptr->check_name(name_))
return true; return true;
return false; return false;
} }
@ -630,7 +630,7 @@ protected:
// Collect positionals // Collect positionals
// Loop over all positionals // Loop over all positionals
for(int i=0; i<missing.size(); i++) { for(size_t i=0; i<missing.size(); i++) {
// Skip non-positionals (speedup) // Skip non-positionals (speedup)
if(missing.at(i).first != detail::Classifer::NONE) if(missing.at(i).first != detail::Classifer::NONE)