diff --git a/cmake/utils.cmake b/cmake/utils.cmake index d56fc27a..fb9bb6ce 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -29,21 +29,27 @@ endfunction() function(spdlog_enable_warnings target_name) if(SPDLOG_BUILD_WARNINGS) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - list(APPEND MSVC_OPTIONS "/W3") + list(APPEND WARNING_OPTIONS "/W3") if(MSVC_VERSION GREATER 1900) # Allow non fatal security warnings for msvc 2015 - list(APPEND MSVC_OPTIONS "/WX") + list(APPEND WARNING_OPTIONS "/WX") endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL ".*Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + list(APPEND WARNING_OPTIONS + -Wall + -Wconversion + -Werror + -Wextra + -Wfatal-errors + -Wpedantic + -Wshadow + ) endif() target_compile_options( ${target_name} - PRIVATE $<$,$,$>: - -Wall - -Wextra - -Wconversion - -pedantic - -Wfatal-errors> - $<$:${MSVC_OPTIONS}>) + PRIVATE + ${WARNING_OPTIONS} + ) endif() endfunction() diff --git a/include/spdlog/fmt/bundled/core.h b/include/spdlog/fmt/bundled/core.h index 0e0824f5..56902535 100644 --- a/include/spdlog/fmt/bundled/core.h +++ b/include/spdlog/fmt/bundled/core.h @@ -1252,10 +1252,10 @@ class dynamic_arg_list { public: template const T& push(const Arg& arg) { - auto node = std::unique_ptr>(new typed_node(arg)); - auto& value = node->value; - node->next = std::move(head_); - head_ = std::move(node); + auto node_ptr = std::unique_ptr>(new typed_node(arg)); + auto& value = node_ptr->value; + node_ptr->next = std::move(head_); + head_ = std::move(node_ptr); return value; } }; diff --git a/include/spdlog/fmt/bundled/format.h b/include/spdlog/fmt/bundled/format.h index 4e96539f..4dbbf6ca 100644 --- a/include/spdlog/fmt/bundled/format.h +++ b/include/spdlog/fmt/bundled/format.h @@ -3244,9 +3244,9 @@ template <> struct formatter { specs_.precision, specs_.precision_ref, ctx); using range_type = internal::output_range; - internal::basic_writer writer(range_type(ctx.out())); - writer.write_bytes(b.data_, specs_); - return writer.out(); + internal::basic_writer format_writer(range_type(ctx.out())); + format_writer.write_bytes(b.data_, specs_); + return format_writer.out(); } private: