From d182e39881061b11d1eb85426d9a6953e3171bf5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 15 Oct 2023 11:09:07 -0600 Subject: Use C++17 [[fallthrough]] attribute This changes gdb to use the C++17 [[fallthrough]] attribute rather than special comments. This was mostly done by script, but I neglected a few spellings and so also fixed it up by hand. I suspect this fixes the bug mentioned below, by switching to a standard approach that, presumably, clang supports. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23159 Approved-By: John Baldwin Approved-By: Luis Machado Approved-By: Pedro Alves --- gdbsupport/btrace-common.cc | 6 ++---- gdbsupport/format.cc | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'gdbsupport') diff --git a/gdbsupport/btrace-common.cc b/gdbsupport/btrace-common.cc index 932a118..c09fd50 100644 --- a/gdbsupport/btrace-common.cc +++ b/gdbsupport/btrace-common.cc @@ -134,8 +134,7 @@ btrace_data_append (struct btrace_data *dst, case BTRACE_FORMAT_NONE: dst->format = BTRACE_FORMAT_BTS; dst->variant.bts.blocks = new std::vector; - - /* Fall-through. */ + [[fallthrough]]; case BTRACE_FORMAT_BTS: { unsigned int blk; @@ -163,8 +162,7 @@ btrace_data_append (struct btrace_data *dst, dst->format = BTRACE_FORMAT_PT; dst->variant.pt.data = NULL; dst->variant.pt.size = 0; - - /* fall-through. */ + [[fallthrough]]; case BTRACE_FORMAT_PT: { gdb_byte *data; diff --git a/gdbsupport/format.cc b/gdbsupport/format.cc index 6e5a3cb..85d1f9a 100644 --- a/gdbsupport/format.cc +++ b/gdbsupport/format.cc @@ -257,14 +257,14 @@ format_pieces::format_pieces (const char **arg, bool gdb_extensions, case 'u': if (seen_hash) bad = 1; - /* FALLTHROUGH */ + [[fallthrough]]; case 'o': case 'x': case 'X': if (seen_space || seen_plus) bad = 1; - /* FALLTHROUGH */ + [[fallthrough]]; case 'd': case 'i': -- cgit v1.1