Fix warnings from clang
This commit is contained in:
parent
eec0299cbc
commit
09748275db
@ -12,7 +12,7 @@ compilers:
|
|||||||
build_tag: AddressSanitizer
|
build_tag: AddressSanitizer
|
||||||
version: "3.6"
|
version: "3.6"
|
||||||
skip_packaging: true
|
skip_packaging: true
|
||||||
cmake_extra_flags: -DUSE_LIBCXX:BOOL=OFF -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_ADDRESS_SANITIZER:BOOL=ON
|
cmake_extra_flags: -DRUN_FUZZY_TESTS:BOOL=TRUE -DUSE_LIBCXX:BOOL=OFF -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_ADDRESS_SANITIZER:BOOL=ON
|
||||||
- name: "clang"
|
- name: "clang"
|
||||||
build_tag: ThreadSanitizer
|
build_tag: ThreadSanitizer
|
||||||
version: "3.6"
|
version: "3.6"
|
||||||
|
@ -31,6 +31,8 @@ namespace chaiscript
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
option_explicit_set(const option_explicit_set &) = default;
|
||||||
|
|
||||||
virtual ~option_explicit_set() CHAISCRIPT_NOEXCEPT {}
|
virtual ~option_explicit_set() CHAISCRIPT_NOEXCEPT {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -660,14 +660,16 @@ namespace chaiscript
|
|||||||
|
|
||||||
const auto val = prefixed?std::string(t_val.begin()+2,t_val.end()):t_val;
|
const auto val = prefixed?std::string(t_val.begin()+2,t_val.end()):t_val;
|
||||||
|
|
||||||
try {
|
|
||||||
auto u = std::stoll(val,nullptr,base);
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
|
#pragma GCC diagnostic ignored "-Wtautological-compare"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto u = std::stoll(val,nullptr,base);
|
||||||
|
|
||||||
|
|
||||||
if (!unsigned_ && !long_ && u >= std::numeric_limits<int>::min() && u <= std::numeric_limits<int>::max()) {
|
if (!unsigned_ && !long_ && u >= std::numeric_limits<int>::min() && u <= std::numeric_limits<int>::max()) {
|
||||||
return const_var(static_cast<int>(u));
|
return const_var(static_cast<int>(u));
|
||||||
} else if ((unsigned_ || base != 10) && !long_ && u >= std::numeric_limits<unsigned int>::min() && u <= std::numeric_limits<unsigned int>::max()) {
|
} else if ((unsigned_ || base != 10) && !long_ && u >= std::numeric_limits<unsigned int>::min() && u <= std::numeric_limits<unsigned int>::max()) {
|
||||||
@ -682,10 +684,6 @@ namespace chaiscript
|
|||||||
return const_var(static_cast<unsigned long long>(u));
|
return const_var(static_cast<unsigned long long>(u));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} catch (const std::out_of_range &) {
|
} catch (const std::out_of_range &) {
|
||||||
// too big to be signed
|
// too big to be signed
|
||||||
try {
|
try {
|
||||||
@ -701,6 +699,11 @@ namespace chaiscript
|
|||||||
return const_var(std::numeric_limits<long long>::max());
|
return const_var(std::numeric_limits<long long>::max());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename ... Param>
|
template<typename T, typename ... Param>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user