Commit 4e99e09b authored by Victor Zverovich's avatar Victor Zverovich

Fix warnings

parent 1607a018
...@@ -91,11 +91,12 @@ cmake_flags = [ ...@@ -91,11 +91,12 @@ cmake_flags = [
] ]
# Make sure the fuzzers still compile. # Make sure the fuzzers still compile.
main_cmake_flags = list(cmake_flags)
if 'ENABLE_FUZZING' in os.environ: if 'ENABLE_FUZZING' in os.environ:
cmake_flags += ['-DFMT_FUZZ=ON', '-DFMT_FUZZ_LINKMAIN=On'] main_cmake_flags += ['-DFMT_FUZZ=ON', '-DFMT_FUZZ_LINKMAIN=On']
check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', '-DFMT_WERROR=ON', fmt_dir] + check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', '-DFMT_WERROR=ON', fmt_dir] +
cmake_flags, cwd=build_dir) main_cmake_flags, cwd=build_dir)
# Build the library. # Build the library.
check_call(['cmake', '--build','.'], cwd=build_dir) check_call(['cmake', '--build','.'], cwd=build_dir)
......
...@@ -215,7 +215,7 @@ struct scan_handler : error_handler { ...@@ -215,7 +215,7 @@ struct scan_handler : error_handler {
template <typename... Args> template <typename... Args>
std::array<internal::scan_arg, sizeof...(Args)> make_scan_args(Args&... args) { std::array<internal::scan_arg, sizeof...(Args)> make_scan_args(Args&... args) {
return std::array<internal::scan_arg, sizeof...(Args)>{args...}; return {{args...}};
} }
string_view::iterator vscan(string_view input, string_view format_str, string_view::iterator vscan(string_view input, string_view format_str,
......
...@@ -123,7 +123,8 @@ template <> struct std::formatter<S> { ...@@ -123,7 +123,8 @@ template <> struct std::formatter<S> {
auto format(S s, format_context& ctx) { auto format(S s, format_context& ctx) {
int width = visit_format_arg( int width = visit_format_arg(
[](auto value) -> int { [](auto value) -> int {
if constexpr (!is_integral_v<decltype(value)>) using type = decltype(value);
if constexpr (!is_integral_v<type> || is_same_v<type, bool>)
throw format_error("width is not integral"); throw format_error("width is not integral");
// else if (value < 0 || value > numeric_limits<int>::max()) // else if (value < 0 || value > numeric_limits<int>::max())
else if (fmt::internal::is_negative(value) || else if (fmt::internal::is_negative(value) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment