Skip to content

Commit f5b69b5

Browse files
committed
Silence spurious maybe uninitialised warning
1 parent 882bd0d commit f5b69b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/goto-instrument/unwindset.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,19 @@ void unwindsett::parse_unwindset_one_loop(
171171
uw = unsafe_string2unsigned(uw_string);
172172

173173
if(thread_nr.has_value())
174+
{
175+
// Work around spurious GCC 12 warning about thread_nr being uninitialised.
176+
#pragma GCC diagnostic push
177+
#ifndef __clang__
178+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
179+
#endif
174180
thread_loop_map[std::pair<irep_idt, unsigned>(id, *thread_nr)] = uw;
181+
#pragma GCC diagnostic pop
182+
}
175183
else
184+
{
176185
loop_map[id] = uw;
186+
}
177187
}
178188
}
179189

0 commit comments

Comments
 (0)