diff --git a/include/fmt/core.h b/include/fmt/core.h index d2c9633c..a35ddec2 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -669,7 +669,7 @@ template class buffer { size_(sz), capacity_(cap) {} - ~buffer() = default; + virtual ~buffer() = default; /** Sets the buffer data and capacity. */ void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT { diff --git a/include/fmt/format.h b/include/fmt/format.h index 464c0d72..726c90e4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1609,7 +1609,7 @@ template struct int_writer { char digits[40]; format_decimal(digits, abs_value, num_digits); basic_memory_buffer buffer; - size += prefix_size; + size += static_cast(prefix_size); const auto usize = to_unsigned(size); buffer.resize(usize); basic_string_view s(&sep, sep_size); @@ -3493,7 +3493,7 @@ inline std::string to_string(T value) { // The buffer should be large enough to store the number including the sign or // "false" for bool. constexpr int max_size = detail::digits10() + 2; - char buffer[max_size > 5 ? max_size : 5]; + char buffer[max_size > 5 ? static_cast(max_size) : 5]; char* begin = buffer; return std::string(begin, detail::write(begin, value)); }