Explicitly annotate intentional switch fallthrough

This silences a very useful warning in GCC 10.
This commit is contained in:
Mahmoud Al-Qudsi 2021-02-06 17:01:17 -06:00
parent b7e892d545
commit ea1a4b7932
2 changed files with 8 additions and 2 deletions

View file

@ -198,3 +198,9 @@
#else
#define __warn_unused_type
#endif
#if __has_attribute(fallthrough)
#define __fallthrough__ __attribute__ ((fallthrough))
#else
#define __fallthrough__
#endif

View file

@ -2941,9 +2941,9 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
parser().libdata().is_repaint = false;
break;
}
// Else we repaint as normal
// Else we repaint as normal.
__fallthrough__
}
/* fallthrough */
case rl::force_repaint:
case rl::repaint: {
parser().libdata().is_repaint = true;