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:
parent
396e276286
commit
8ab437a989
@ -766,8 +766,16 @@ static void color_string_internal(const wcstring &buffstr, highlight_spec_t base
|
||||
}
|
||||
|
||||
// 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;
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user