Skip to content

Commit

Permalink
Enable gcc warning -Wshadow
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Aug 22, 2024
1 parent a9a5bdd commit 147d4c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 -Wno-long-long -Wshadow")
# gcc 7.5 reports Wsign-conversion even on static_cast, reportedly fixed in gcc 9.3
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.3.0")
set(WARNINGS_SETUP "${WARNINGS_SETUP} -Wsign-conversion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ TEST_F(ParameterizedNestedInArrayTest, writeRead)
{
Holder holder({{Element{Parameterized{6}}}}, {{Element{Parameterized{6}}}});

const auto bitBuffer = zserio::serialize(holder);
const Holder readHolder = zserio::deserialize<Holder>(bitBuffer);
const auto bitBufferHolder = zserio::serialize(holder);
const Holder readHolder = zserio::deserialize<Holder>(bitBufferHolder);

ASSERT_EQ(holder, readHolder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TEST_F(StructureWithRemovedEnumItemFieldTest, fieldConstructor)

TEST_F(StructureWithRemovedEnumItemFieldTest, bitStreamReaderConstructor)
{
zserio::BitBuffer bitBuffer(8);
zserio::BitStreamWriter writer(bitBuffer);
zserio::BitBuffer smallBitBuffer(8);
zserio::BitStreamWriter writer(smallBitBuffer);
writer.writeBits(0, 8);

zserio::BitStreamReader reader(writer.getWriteBuffer(), writer.getBitPosition(), zserio::BitsTag());
Expand Down

0 comments on commit 147d4c6

Please sign in to comment.