Skip to content

Commit 07137b9

Browse files
authored
fix(cpp): resolve sign-compare warning in row writer (#4192)
This PR resolves a -Wsign-compare warning in writer.cc by applying a static_cast<uint64_t> to fixed_part_bytes before comparing it against data_size
1 parent 80bcf64 commit 07137b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎cpp/fory/row/writer.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void ArrayWriter::reset(uint32_t num_elements) {
210210
FORY_CHECK(data_size < std::numeric_limits<int>::max());
211211
int fixed_part_bytes =
212212
util::round_number_of_bytes_to_nearest_word(static_cast<int>(data_size));
213-
assert((fixed_part_bytes >= data_size) && "too much elements");
213+
assert((static_cast<uint64_t>(fixed_part_bytes) >= data_size) && "too much elements");
214214
buffer_->grow(header_in_bytes_ + fixed_part_bytes);
215215

216216
// write num_elements and clear out null bits to header

0 commit comments

Comments
 (0)