Try fix -Wsign-compare

This commit is contained in:
proller 2019-07-23 12:32:08 +03:00
parent d80f5167cb
commit 8e8ebf9c44
3 changed files with 3 additions and 9 deletions

2
contrib/libunwind vendored

@ -1 +1 @@
Subproject commit 17a48fbfa7913ee889960a698516bd3ba51d63ee
Subproject commit ec86b1c6a2c6b8ba316f429db9a6d4122dd12710

View File

@ -254,12 +254,9 @@ void ReadBufferAIO::prepare()
/// Region of the disk from which we want to read data.
const off_t region_begin = first_unread_pos_in_file;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
if ((requested_byte_count > std::numeric_limits<off_t>::max()) ||
if ((requested_byte_count > static_cast<size_t>(std::numeric_limits<off_t>::max())) ||
(first_unread_pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(requested_byte_count))))
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
#pragma GCC diagnostic pop
const off_t region_end = first_unread_pos_in_file + requested_byte_count;

View File

@ -274,12 +274,9 @@ void WriteBufferAIO::prepare()
/// Region of the disk in which we want to write data.
const off_t region_begin = pos_in_file;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
if ((flush_buffer.offset() > std::numeric_limits<off_t>::max()) ||
if ((flush_buffer.offset() > static_cast<size_t>(std::numeric_limits<off_t>::max())) ||
(pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(flush_buffer.offset()))))
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
#pragma GCC diagnostic pop
const off_t region_end = pos_in_file + flush_buffer.offset();
const size_t region_size = region_end - region_begin;