Silence gcc warning

This complained that the variable might be uninitialized *right* after
the check that it wasn't, because it doesn't understand maybe_t.
This commit is contained in:
Fabian Boehm 2022-10-05 19:07:41 +02:00
parent 396e276286
commit 8ab437a989

View file

@ -766,8 +766,16 @@ static void color_string_internal(const wcstring &buffstr, highlight_spec_t base
} }
// Error on unclosed quotes. // Error on unclosed quotes.
if (unclosed_quote_offset) { if (unclosed_quote_offset.has_value()) {
// gcc complains this is uninitialized
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
colors[*unclosed_quote_offset] = highlight_role_t::error; colors[*unclosed_quote_offset] = highlight_role_t::error;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
} }
} }