Fix two warnings on raised by Visual Studio 2015 compiler + disable -Wall and -Wextra when using Visual Studio compiler
This commit is contained in:
parent
5bf860315e
commit
a23f87ee35
@ -31,9 +31,12 @@ target_include_directories(json-schema-validator
|
||||
target_compile_features(json-schema-validator
|
||||
PUBLIC
|
||||
cxx_range_for) # for C++11 - flags
|
||||
# Enable more compiler warnings, except when using Visual Studio compiler
|
||||
if(NOT MSVC)
|
||||
target_compile_options(json-schema-validator
|
||||
PUBLIC
|
||||
-Wall) # bad, better use something else based on compiler type
|
||||
-Wall -Wextra)
|
||||
endif()
|
||||
target_link_libraries(json-schema-validator
|
||||
PUBLIC
|
||||
json-hpp)
|
||||
|
||||
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
json document;
|
||||
|
||||
try {
|
||||
document << std::cin;
|
||||
std::cin >> document;
|
||||
validator.validate(document);
|
||||
} catch (std::exception &e) {
|
||||
std::cerr << "schema validation failed\n";
|
||||
|
||||
@ -344,7 +344,7 @@ void json_validator::validate(const json &instance, const json &schema_, const s
|
||||
try {
|
||||
validate(instance, attr.value(), name);
|
||||
ok = false;
|
||||
} catch (std::exception &e) {
|
||||
} catch (std::exception &) {
|
||||
ok = true;
|
||||
}
|
||||
if (!ok)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user