diff --git a/cmake/compiler_utils.cmake b/cmake/compiler_utils.cmake index 4fca09284..e59a32e91 100644 --- a/cmake/compiler_utils.cmake +++ b/cmake/compiler_utils.cmake @@ -8,7 +8,7 @@ endfunction() # Prepares warnings setup for current target function(compiler_get_warnings_setup VARNAME) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(WARNINGS_SETUP "-Wall -Wextra -pedantic -Wconversion -Wno-long-long") + set(WARNINGS_SETUP "-Wall -Wextra -pedantic -Wconversion -Wsign-conversion -Wno-long-long") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(WARNINGS_SETUP_LIST "-Weverything" "-Wno-system-headers" diff --git a/compiler/extensions/cpp/runtime/src/zserio/DeltaContext.h b/compiler/extensions/cpp/runtime/src/zserio/DeltaContext.h index bf587daf6..03cb1f037 100644 --- a/compiler/extensions/cpp/runtime/src/zserio/DeltaContext.h +++ b/compiler/extensions/cpp/runtime/src/zserio/DeltaContext.h @@ -139,7 +139,7 @@ class DeltaContext } else { - return m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0); + return static_cast(m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0)); } } @@ -273,7 +273,7 @@ class DeltaContext { if (isFlagSet(IS_PACKED_FLAG)) { - const size_t deltaBitSize = m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0); + const size_t deltaBitSize = static_cast(m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0)); const size_t packedBitSizeWithDescriptor = 1 + MAX_BIT_NUMBER_BITS + // descriptor m_firstElementBitSize + (m_numElements - 1) * deltaBitSize; const size_t unpackedBitSizeWithDescriptor = 1 + m_unpackedBitSize;