diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt index 112f539977..79d8e66765 100644 --- a/cpp/examples/CMakeLists.txt +++ b/cpp/examples/CMakeLists.txt @@ -15,3 +15,10 @@ add_executable(basic_io basic_io.cpp) 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") + target_compile_options( + basic_io PRIVATE "$<$:${KVIKIO_CXX_FLAGS}>" + ) +endif() diff --git a/cpp/include/kvikio/utils.hpp b/cpp/include/kvikio/utils.hpp index 69b91b459f..2ecd0f6fff 100644 --- a/cpp/include/kvikio/utils.hpp +++ b/cpp/include/kvikio/utils.hpp @@ -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::max()) { + if (x >= static_cast(std::numeric_limits::max())) { throw CUfileException("size_t argument too large to fit off_t"); } return static_cast(x);