From a4d5770c464ec966c8a0b738b0a4e2a2b84bae1e Mon Sep 17 00:00:00 2001 From: Sergey Markelov Date: Mon, 21 Oct 2024 10:00:31 -0700 Subject: [PATCH] Fix narrowing conversion warning in struct fstring Warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data. Client applications fail to compile if warnings are treated as errors. --- include/fmt/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index e0baae256347..f3820d58f4ad 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2634,7 +2634,7 @@ inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; } /// A compile-time format string. template struct fstring { private: - static constexpr int num_static_named_args = + static constexpr size_t num_static_named_args = detail::count_static_named_args(); using checker = detail::format_string_checker<