Skip to content

Commit

Permalink
convert_size2off(): fix different signedness
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Apr 22, 2022
1 parent eaba165 commit 53c9b56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_include_directories(basic_io PRIVATE ../include ${cuFile_INCLUDE_DIRS})
target_link_libraries(basic_io PRIVATE kvikio CUDA::cudart)

if(CMAKE_COMPILER_IS_GNUCXX)
set(KVIKIO_CXX_FLAGS "-Wall;-Werror;-Wno-unknown-pragmas;-Werror=sign-compare")
set(KVIKIO_CXX_FLAGS "-Wall;-Werror;-Wno-unknown-pragmas")
target_compile_options(
basic_io PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${KVIKIO_CXX_FLAGS}>"
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inline constexpr std::size_t page_size = 4096;

[[nodiscard]] inline off_t convert_size2off(std::size_t x)
{
if (x >= std::numeric_limits<off_t>::max()) {
if (x >= static_cast<std::size_t>(std::numeric_limits<off_t>::max())) {
throw CUfileException("size_t argument too large to fit off_t");
}
return static_cast<off_t>(x);
Expand Down

0 comments on commit 53c9b56

Please sign in to comment.