From 4ad5c7827db6da0771c92a0d1084ecb095e3089c Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 31 Oct 2025 10:14:23 +0100 Subject: [PATCH] Build with warnings as errors (#289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #23858. Build with warnings as errors. Signed-off-by: Miguel Company * Refs #23858. Add option for MSVC Signed-off-by: Miguel Company * Refs #23858. Fix warning. Signed-off-by: Miguel Company * Refs #23858. Move to CI Signed-off-by: Ricardo González Moreno * Apply suggestion Co-authored-by: Miguel Company Signed-off-by: Ricardo González --------- Signed-off-by: Miguel Company Signed-off-by: Ricardo González Moreno Signed-off-by: Ricardo González Co-authored-by: Ricardo González Moreno (cherry picked from commit 9beec7e6934b020e5de39f97a244d6e4f28cb6ce) --- .github/workflows/reusable-ci.yml | 3 ++- test/cdr/SimpleTest.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 4b69f6fc..e0ab3b5d 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/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);