aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-10-15 11:09:07 -0600
committerTom Tromey <tom@tromey.com>2023-11-29 14:29:43 -0700
commitd182e39881061b11d1eb85426d9a6953e3171bf5 (patch)
treec292f0615eee648207c86ae7035479cb518ea81a /gdbsupport
parenta0dc1f9a12a4394463b9dbf5927166f2ab8518a6 (diff)
downloadbinutils-d182e39881061b11d1eb85426d9a6953e3171bf5.zip
binutils-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.gz
binutils-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.bz2
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 <jhb@FreeBSD.org> Approved-By: Luis Machado <luis.machado@arm.com> Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdbsupport')
-rw-r--r--gdbsupport/btrace-common.cc6
-rw-r--r--gdbsupport/format.cc4
2 files changed, 4 insertions, 6 deletions
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<btrace_block>;
-
- /* 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':