was wrong!

../dbms/src/IO/WriteBufferAIO.cpp:277:54: error: result of comparison 'ssize_t' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-type-limit-compare]
    if ((static_cast<ssize_t>(flush_buffer.offset()) > std::numeric_limits<off_t>::max()) ||
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
proller 2019-06-28 20:23:11 +03:00
parent b89c38f0f0
commit a5e2a725d2
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ endif ()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mimalloc/include/mimalloc.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mimalloc/include/mimalloc.h")
message (WARNING "submodule contrib/mimalloc is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/mimalloc is missing. to fix try run: \n git submodule update --init --recursive")
return () return()
endif () endif ()
if (ENABLE_MIMALLOC) if (ENABLE_MIMALLOC)

View File

@ -254,7 +254,7 @@ void ReadBufferAIO::prepare()
/// Region of the disk from which we want to read data. /// Region of the disk from which we want to read data.
const off_t region_begin = first_unread_pos_in_file; const off_t region_begin = first_unread_pos_in_file;
if ((static_cast<ssize_t>(requested_byte_count) > std::numeric_limits<off_t>::max()) || if ((requested_byte_count > std::numeric_limits<off_t>::max()) ||
(first_unread_pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(requested_byte_count)))) (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); throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);

View File

@ -274,7 +274,7 @@ void WriteBufferAIO::prepare()
/// Region of the disk in which we want to write data. /// Region of the disk in which we want to write data.
const off_t region_begin = pos_in_file; const off_t region_begin = pos_in_file;
if ((static_cast<ssize_t>(flush_buffer.offset()) > std::numeric_limits<off_t>::max()) || if ((flush_buffer.offset() > std::numeric_limits<off_t>::max()) ||
(pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(flush_buffer.offset())))) (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); throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);