diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3e8a95..5ec5e13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed +- Fix `-Wsign-conversion` warning in `basic_pbf_writer::commit_submessage()`. + ## [1.8.2] - 2026-06-30 ### Fixed diff --git a/include/protozero/basic_pbf_writer.hpp b/include/protozero/basic_pbf_writer.hpp index cc0f7cd5..9e0af4ea 100644 --- a/include/protozero/basic_pbf_writer.hpp +++ b/include/protozero/basic_pbf_writer.hpp @@ -204,7 +204,7 @@ class basic_pbf_writer { protozero_assert(buffer_customization::size(m_data) >= m_pos - reserve_bytes); const auto n = add_varint_to_buffer(buffer_customization::at_pos(m_data, m_pos - reserve_bytes), length); - buffer_customization::erase_range(m_data, m_pos - reserve_bytes + n, m_pos); + buffer_customization::erase_range(m_data, m_pos - reserve_bytes + static_cast(n), m_pos); m_pos = 0; }