Skip to content

Commit 62358f5

Browse files
committed
Silence spurious maybe uninitialised warning
1 parent 42d5ce2 commit 62358f5

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
@@ -172,9 +172,19 @@ void unwindsett::parse_unwindset_one_loop(
172172
uw = unsafe_string2unsigned(uw_string);
173173

174174
if(thread_nr.has_value())
175+
{
176+
// Work around spurious GCC 12 warning about thread_nr being uninitialised.
177+
#pragma GCC diagnostic push
178+
#ifndef __clang__
179+
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
180+
#endif
175181
thread_loop_map[std::pair<irep_idt, unsigned>(id, *thread_nr)] = uw;
182+
#pragma GCC diagnostic pop
183+
}
176184
else
185+
{
177186
loop_map[id] = uw;
187+
}
178188
}
179189
}
180190

0 commit comments

Comments
 (0)