From 6278b7bbfaf54ba029d4449edca1448ed45f63c2 Mon Sep 17 00:00:00 2001 From: Paul Kippes Date: Mon, 19 Feb 2024 23:54:12 -0800 Subject: [PATCH] Fix ambiguous type w/pos_type; Silence register kw deprecation Build on PR #6 from bonki an the additional commit they had on top of master at commit 43db1608d9476a17637f6b941320b1b373a2b5e8. --- CMakeLists.txt | 11 ++++++++++- src/utils/buffer_stream.cc | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) 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; }