From 375b394fbc28ece16a0fd8b45a49759c8be20a6e Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 30 Oct 2025 11:16:49 +0100 Subject: [PATCH 1/5] Refs #23858. Build with warnings as errors. Signed-off-by: Miguel Company --- cmake/common/check_configuration.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/common/check_configuration.cmake b/cmake/common/check_configuration.cmake index ac60c5aa..0d9a87e8 100644 --- a/cmake/common/check_configuration.cmake +++ b/cmake/common/check_configuration.cmake @@ -194,6 +194,7 @@ function(set_common_compile_options target) target_compile_options(${target} PRIVATE /W4) else() target_compile_options(${target} PRIVATE -Wall + -Werror -Wextra -Wshadow $<$:-Wnon-virtual-dtor> From 13bb5a59dc8bab6d78e2a719f10149c241d9ec00 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 30 Oct 2025 11:42:29 +0100 Subject: [PATCH 2/5] Refs #23858. Add option for MSVC Signed-off-by: Miguel Company --- cmake/common/check_configuration.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/common/check_configuration.cmake b/cmake/common/check_configuration.cmake index 0d9a87e8..0a437241 100644 --- a/cmake/common/check_configuration.cmake +++ b/cmake/common/check_configuration.cmake @@ -191,7 +191,7 @@ function(set_common_compile_options target) enable_language(C) enable_language(CXX) if(MSVC OR MSVC_IDE) - target_compile_options(${target} PRIVATE /W4) + target_compile_options(${target} PRIVATE /W4 /WX) else() target_compile_options(${target} PRIVATE -Wall -Werror From 2e06e0110c3020486112922293b076fbafa84fde Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 30 Oct 2025 12:08:02 +0100 Subject: [PATCH 3/5] Refs #23858. Fix warning. Signed-off-by: Miguel Company --- test/cdr/SimpleTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cdr/SimpleTest.cpp b/test/cdr/SimpleTest.cpp index 09848fc8..38e8b6ae 100644 --- a/test/cdr/SimpleTest.cpp +++ b/test/cdr/SimpleTest.cpp @@ -2265,7 +2265,7 @@ TEST(CDRTests, DeserializeIntoANonEmptyMapInXCDRv1) }; std::map initialized_map{ - {1, "a"} + {static_cast(1u), "a"} }; FastBuffer cdr_buffer(buffer, 14); From 70294999fb768cac6d456d5e80a99347afefdd6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Fri, 31 Oct 2025 09:25:12 +0100 Subject: [PATCH 4/5] Refs #23858. Move to CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- .github/workflows/reusable-ci.yml | 3 ++- cmake/common/check_configuration.cmake | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 4b69f6fc..67f912dd 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -53,6 +53,7 @@ on: type: boolean default: false env: + colcon-build-default-cmake-args: ${{ contains(inputs.os-version, 'windows') && '-DCMAKE_CXX_FLAGS_INIT="/WX"' || '-DCMAKE_CXX_FLAGS_INIT="-Werror"' }} toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} defaults: run: @@ -122,7 +123,7 @@ jobs: colcon_build_args: ${{ inputs.colcon-args }} colcon_build_args_default: --event-handlers=console_direct+ cmake_args: ${{ inputs.cmake-args }} - cmake_args_default: ${{ env.toolset }} + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} ${{ env.toolset }} cmake_build_type: ${{ matrix.cmake-build-type }} workspace: ${{ github.workspace }} diff --git a/cmake/common/check_configuration.cmake b/cmake/common/check_configuration.cmake index 0a437241..ac60c5aa 100644 --- a/cmake/common/check_configuration.cmake +++ b/cmake/common/check_configuration.cmake @@ -191,10 +191,9 @@ function(set_common_compile_options target) enable_language(C) enable_language(CXX) if(MSVC OR MSVC_IDE) - target_compile_options(${target} PRIVATE /W4 /WX) + target_compile_options(${target} PRIVATE /W4) else() target_compile_options(${target} PRIVATE -Wall - -Werror -Wextra -Wshadow $<$:-Wnon-virtual-dtor> From 32a9b9290223e2cafe50f5e587302b3d35464aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Fri, 31 Oct 2025 10:06:29 +0100 Subject: [PATCH 5/5] Apply suggestion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miguel Company Signed-off-by: Ricardo González --- .github/workflows/reusable-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 67f912dd..e0ab3b5d 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -53,7 +53,7 @@ on: type: boolean default: false env: - colcon-build-default-cmake-args: ${{ contains(inputs.os-version, 'windows') && '-DCMAKE_CXX_FLAGS_INIT="/WX"' || '-DCMAKE_CXX_FLAGS_INIT="-Werror"' }} + colcon-build-default-cmake-args: ${{ contains(inputs.os-version, 'windows') && '-DCMAKE_CXX_FLAGS_INIT="/WX"' || '-DCMAKE_CXX_FLAGS_INIT="-Werror"' }} toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} defaults: run: