Skip to content

Commit

Permalink
executor: fix compiler warnings in 32-bit mode
Browse files Browse the repository at this point in the history
executor/executor.cc: In function ‘uint64 read_input(uint8**, bool)’:
executor/executor.cc:1487:59: error: format ‘%zu’ expects argument of type
                              ‘size_t’, but argument 3 has type ‘int’
			      [-Werror=format=]
executor/executor.cc:1495:67: error: format ‘%zu’ expects argument of type
                                     ‘size_t’, but argument 3 has type ‘int’
				     [-Werror=format=]

Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
  • Loading branch information
eaibmz committed Jun 13, 2024
1 parent bc594ff commit 0b0626b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions executor/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1484,15 +1484,15 @@ uint64 read_input(uint8** input_posp, bool peek)
for (int i = 0;; i++, shift += 7) {
const int maxLen = 10;
if (i == maxLen)
failmsg("varint overflow", "pos=%zu", *input_posp - input_data);
failmsg("varint overflow", "pos=%zu", (size_t)(*input_posp - input_data));
if (input_pos >= input_data + kMaxInput)
failmsg("input command overflows input", "pos=%p: [%p:%p)",
input_pos, input_data, input_data + kMaxInput);
uint8 b = *input_pos++;
v |= uint64(b & 0x7f) << shift;
if (b < 0x80) {
if (i == maxLen - 1 && b > 1)
failmsg("varint overflow", "pos=%zu", *input_posp - input_data);
failmsg("varint overflow", "pos=%zu", (size_t)(*input_posp - input_data));
break;
}
}
Expand Down

0 comments on commit 0b0626b

Please sign in to comment.