From 0f128fd5613905f8e48695fd0193a53196d330bf Mon Sep 17 00:00:00 2001 From: charles-david Date: Thu, 31 Jan 2019 22:47:02 -0500 Subject: [PATCH 1/3] Warning for shadowed parameter corrected in common.h However, not in bundled fmt. Corrects compiling with basic logger with header only and -Werror. --- CMakeLists.txt | 3 ++- include/spdlog/common.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0ddaeef..a35de32a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) #--------------------------------------------------------------------------------------- # compiler config #--------------------------------------------------------------------------------------- -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -30,6 +30,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH add_compile_options("-Wconversion") add_compile_options("-pedantic") add_compile_options("-Wfatal-errors") + add_compile_options("-Wshadow") endif() #--------------------------------------------------------------------------------------- diff --git a/include/spdlog/common.h b/include/spdlog/common.h index d078a1ab..49d2b865 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -210,10 +210,10 @@ struct source_loc , funcname{""} { } - SPDLOG_CONSTEXPR source_loc(const char *filename, int line, const char *funcname) - : filename{filename} - , line{static_cast(line)} - , funcname{funcname} + SPDLOG_CONSTEXPR source_loc(const char *t_filename, int t_line, const char *t_funcname) + : filename{t_filename} + , line{static_cast(t_line)} + , funcname{t_funcname} { } From e4b7dbce7f5124084b6443f618ef4e670644964d Mon Sep 17 00:00:00 2001 From: charles-david Date: Thu, 31 Jan 2019 23:05:38 -0500 Subject: [PATCH 2/3] CMakeLists.txt same as v1.x branch. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a35de32a..f0ddaeef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) #--------------------------------------------------------------------------------------- # compiler config #--------------------------------------------------------------------------------------- -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -30,7 +30,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH add_compile_options("-Wconversion") add_compile_options("-pedantic") add_compile_options("-Wfatal-errors") - add_compile_options("-Wshadow") endif() #--------------------------------------------------------------------------------------- From 20a0f82701c9488ca21274c6e1eeff752ea9bda0 Mon Sep 17 00:00:00 2001 From: charles-david Date: Fri, 1 Feb 2019 07:59:50 -0500 Subject: [PATCH 3/3] Renamed input parameters to "params_in". --- include/spdlog/common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 49d2b865..d8c5811c 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -210,10 +210,10 @@ struct source_loc , funcname{""} { } - SPDLOG_CONSTEXPR source_loc(const char *t_filename, int t_line, const char *t_funcname) - : filename{t_filename} - , line{static_cast(t_line)} - , funcname{t_funcname} + SPDLOG_CONSTEXPR source_loc(const char *filename_in, int line_in, const char *funcname_in) + : filename{filename_in} + , line{static_cast(line_in)} + , funcname{funcname_in} { }