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