diff --git a/vowpalwabbit/core/src/vw_validate.cc b/vowpalwabbit/core/src/vw_validate.cc index f46db2e076e..8759ed9f46d 100644 --- a/vowpalwabbit/core/src/vw_validate.cc +++ b/vowpalwabbit/core/src/vw_validate.cc @@ -38,11 +38,11 @@ void validate_num_bits(VW::workspace& all) { if (all.weights.sparse) { - std::stringstream ss; - ss << "Bit size is " << all.initial_weights_config.num_bits - << ". While this is allowed for sparse weights, it may cause an overflow and is strongly recommened to use a " - "smaller value."; - all.logger.err_warn(ss.str()); + std::string warning = fmt::format( + "Bit size is {}. While this is allowed for sparse weights, it may cause an overflow and is strongly " + "recommended to use a smaller value.", + all.initial_weights_config.num_bits); + all.logger.err_warn(warning); } else {