From 786659f2dc91f3dc41c3489383483eddbc4a5b9f Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:11:28 -0600 Subject: [PATCH 01/12] Adding Wall Werror to GCC actions --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 60e386db42..89b0c9c51d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,7 +23,7 @@ target_compile_features(glz_test_common INTERFACE cxx_std_23) target_link_libraries(glz_test_common INTERFACE ut::ut glaze::glaze) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(glz_test_common INTERFACE -fno-exceptions -fno-rtti) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>) else() target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic) From 485bb2fd2932c45874d92f988d787ad8b524f5e6 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:12:10 -0600 Subject: [PATCH 02/12] Update jmespath.cpp --- tests/jmespath/jmespath.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/jmespath/jmespath.cpp b/tests/jmespath/jmespath.cpp index 501c823f94..444c744bf3 100644 --- a/tests/jmespath/jmespath.cpp +++ b/tests/jmespath/jmespath.cpp @@ -192,11 +192,6 @@ struct gcc_maybe_uninitialized_t int cqqq{}; }; -struct test_wrapper_t -{ - gcc_maybe_uninitialized_t test{}; -}; - suite gcc_maybe_uninitialized_tests = [] { "gcc_maybe_uninitialized"_test = [] { using namespace std::string_view_literals; From a243468272f870ddc7eb6f9f7f7bbc287b46ee1c Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:36:23 -0600 Subject: [PATCH 03/12] Fix missing break and fix GCC unused warning --- include/glaze/json/schema.hpp | 2 +- include/glaze/json/skip.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/glaze/json/schema.hpp b/include/glaze/json/schema.hpp index e59314d5f4..ac5c832a5f 100644 --- a/include/glaze/json/schema.hpp +++ b/include/glaze/json/schema.hpp @@ -263,7 +263,7 @@ struct glz::meta<glz::detail::schematic> "ExtUnits", // "ExtAdvanced"}; - static constexpr glz::tuple value{&T::type, // + [[maybe_unused]] static constexpr glz::tuple value{&T::type, // &T::properties, // &T::items, // &T::additionalProperties, // diff --git a/include/glaze/json/skip.hpp b/include/glaze/json/skip.hpp index 8ced90832c..6f355db120 100644 --- a/include/glaze/json/skip.hpp +++ b/include/glaze/json/skip.hpp @@ -213,6 +213,7 @@ namespace glz::detail skip_comment(ctx, it, end); if (bool(ctx.error)) [[unlikely]] return; + break; } case 'n': { ++it; From 1f9c7aed2ab48535aaebabfa4739ed4db12f2265 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:49:59 -0600 Subject: [PATCH 04/12] Attempt GCC warning fix --- include/glaze/reflection/to_tuple.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 43767a287c..65c8090c11 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,6 +32,7 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundefined-inline" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From 893c232db2fc53676e18c56a175466d25aae252c Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:52:14 -0600 Subject: [PATCH 05/12] GCC warning hidden? --- include/glaze/reflection/to_tuple.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 65c8090c11..848429a358 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,7 +32,7 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundefined-inline" +#pragma GCC diagnostic ignored "-Wuninitialized" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From 5cb627d725807ef66356b0ae05aeae01f987512b Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:55:34 -0600 Subject: [PATCH 06/12] GCC fix? --- include/glaze/reflection/to_tuple.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 848429a358..826c6bdedf 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,7 +32,7 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wuninitialized" +#pragma GCC diagnostic ignored "-Werror=undefined-symbols" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From 32ae1c90343646e1aa650a9436c21d4b2006888e Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 11:57:16 -0600 Subject: [PATCH 07/12] Wundefined-symbols --- include/glaze/reflection/to_tuple.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 826c6bdedf..7c6529032d 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,7 +32,7 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=undefined-symbols" +#pragma GCC diagnostic ignored "-Wundefined-symbols" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From d50116d6f8cd18fde88d0ba7d801b8557081fce6 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 12:01:34 -0600 Subject: [PATCH 08/12] Weverything --- include/glaze/reflection/to_tuple.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 7c6529032d..1a41a1ec15 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,7 +32,7 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundefined-symbols" +#pragma clang diagnostic ignored "-Weverything" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From 215b0a3a81ba9524f0964cc1681ee1606ce38e48 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 13:38:47 -0600 Subject: [PATCH 09/12] Update to_tuple.hpp --- include/glaze/reflection/to_tuple.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/glaze/reflection/to_tuple.hpp b/include/glaze/reflection/to_tuple.hpp index 1a41a1ec15..43767a287c 100644 --- a/include/glaze/reflection/to_tuple.hpp +++ b/include/glaze/reflection/to_tuple.hpp @@ -32,7 +32,6 @@ namespace glz [[maybe_unused]] constexpr operator T() const; #else #pragma GCC diagnostic push -#pragma clang diagnostic ignored "-Weverything" #pragma GCC diagnostic ignored "-Wmissing-declarations" template <class T> requires(!std::same_as<T, const char*> && !std::same_as<T, std::nullptr_t>) From bc4161696876d03770972cdeddcb8b18ed213192 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 13:59:26 -0600 Subject: [PATCH 10/12] Fix GCC warning --- include/glaze/json/write.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glaze/json/write.hpp b/include/glaze/json/write.hpp index adca5696a8..e5fdb0dd0d 100644 --- a/include/glaze/json/write.hpp +++ b/include/glaze/json/write.hpp @@ -1580,7 +1580,7 @@ namespace glz using V = std::decay_t<decltype(value.value)>; static constexpr auto N = glz::tuple_size_v<V>; - static constexpr auto Opts = opening_and_closing_handled<Options>(); + [[maybe_unused]] static constexpr auto Opts = opening_and_closing_handled<Options>(); // When merging it is possible that objects are completed empty // and therefore behave like skipped members even when skip_null_members is off From 3d8c7c3e30649edd3ec37ed5115c7298f58f19a9 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 14:20:56 -0600 Subject: [PATCH 11/12] Won't use Werror on GCC12 --- tests/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 89b0c9c51d..d066136a01 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,7 +23,13 @@ target_compile_features(glz_test_common INTERFACE cxx_std_23) target_link_libraries(glz_test_common INTERFACE ut::ut glaze::glaze) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(glz_test_common INTERFACE -fno-exceptions -fno-rtti) - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12) + target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>) + else() + target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic) + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>) else() target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic) From ed77ee7e26091cd0e75e65b561b46577c4457129 Mon Sep 17 00:00:00 2001 From: Stephen Berry <stephenberry.developer@gmail.com> Date: Mon, 13 Jan 2025 15:10:32 -0600 Subject: [PATCH 12/12] Update CMakeLists.txt --- tests/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d066136a01..69644bc4fa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,10 +24,10 @@ target_link_libraries(glz_test_common INTERFACE ut::ut glaze::glaze) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(glz_test_common INTERFACE -fno-exceptions -fno-rtti) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12) - target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>) - else() + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic) + else() + target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>) endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(glz_test_common INTERFACE -Wall -Wextra -pedantic $<$<CONFIG:Debug>:-Werror>)