diff --git a/CMakeLists.txt b/CMakeLists.txt index 623b09c..75581aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,16 @@ cmake_minimum_required(VERSION 3.2) project(maconv) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") +add_compile_options(-Wall) +add_compile_options(-Wextra) + +# Register keyword is gone in C++17 and above. Okay +# if we use c++std 14 and just ignore the warning. +add_compile_options(-Wno-deprecated-register) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) # Compile vendor libraries. add_subdirectory("vendors/libhfs") diff --git a/src/utils/buffer_stream.cc b/src/utils/buffer_stream.cc index 416b03d..ba5a449 100644 --- a/src/utils/buffer_stream.cc +++ b/src/utils/buffer_stream.cc @@ -71,7 +71,7 @@ auto RawDataStreamBuf::seekpos(pos_type pos, std::ios_base::openmode which) if (which & std::ios_base::in) setg(eback(), eback() + pos, egptr()); if (which & std::ios_base::out) - pbump(pos - (pptr() - eback())); + pbump(pos - static_cast((pptr() - eback()))); return pos; }