diff --git a/include/fmt/compile.h b/include/fmt/compile.h index db562ce4..d48fc352 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -515,7 +515,8 @@ constexpr parse_specs_result parse_specs(basic_string_view str, auto ctx = basic_format_parse_context(str, {}, arg_id + 1); auto f = formatter(); auto end = f.parse(ctx); - return {f, pos + (end - str.data()) + 1, ctx.next_arg_id()}; + return {f, pos + fmt::detail::to_unsigned(end - str.data()) + 1, + ctx.next_arg_id()}; } // Compiles a non-empty format string and returns the compiled representation