mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
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
1 changed files with 9 additions and 1 deletions
|
@ -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…
Reference in a new issue