Skip to content

Commit 88e7bfe

Browse files
authored
Merge pull request #7852 from tautschnig/features/uninit-warning-gcc6
Silence another spurious maybe-uninitialized warning
2 parents 79186c4 + b7054ba commit 88e7bfe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/lower_byte_operators.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,14 @@ static exprt lower_byte_extract_array_vector(
11111111
if(num_elements.has_value())
11121112
{
11131113
exprt::operandst operands;
1114+
// Work around spurious GCC warning about num_elements being uninitialised.
1115+
#pragma GCC diagnostic push
1116+
#ifndef __clang__
1117+
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
1118+
#endif
11141119
operands.reserve(*num_elements);
11151120
for(std::size_t i = 0; i < *num_elements; ++i)
1121+
#pragma GCC diagnostic pop
11161122
{
11171123
plus_exprt new_offset(
11181124
unpacked.offset(),

0 commit comments

Comments
 (0)