aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
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 /gdb/gdbtypes.c
parenta0dc1f9a12a4394463b9dbf5927166f2ab8518a6 (diff)
downloadgdb-d182e39881061b11d1eb85426d9a6953e3171bf5.zip
gdb-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.gz
gdb-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 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index aa2fce0..4c70c9b 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1101,7 +1101,7 @@ get_discrete_low_bound (struct type *type)
if (!type->is_unsigned ())
return -(1 << (type->length () * TARGET_CHAR_BIT - 1));
- /* fall through */
+ [[fallthrough]];
case TYPE_CODE_CHAR:
return 0;
@@ -1171,7 +1171,7 @@ get_discrete_high_bound (struct type *type)
return -low - 1;
}
- /* fall through */
+ [[fallthrough]];
case TYPE_CODE_CHAR:
{
/* This round-about calculation is to avoid shifting by
@@ -4436,7 +4436,7 @@ rank_one_type_parm_ptr (struct type *parm, struct type *arg, struct value *value
return NS_INTEGER_POINTER_CONVERSION_BADNESS;
}
}
- /* fall through */
+ [[fallthrough]];
case TYPE_CODE_ENUM:
case TYPE_CODE_FLAGS:
case TYPE_CODE_CHAR:
@@ -4608,7 +4608,7 @@ rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *valu
return INTEGER_CONVERSION_BADNESS;
else if (arg->length () < parm->length ())
return INTEGER_PROMOTION_BADNESS;
- /* fall through */
+ [[fallthrough]];
case TYPE_CODE_CHAR:
/* Deal with signed, unsigned, and plain chars for C++ and
with int cases falling through from previous case. */
@@ -4741,7 +4741,7 @@ rank_one_type_parm_struct (struct type *parm, struct type *arg, struct value *va
rank.subrank = distance_to_ancestor (parm, arg, 0);
if (rank.subrank >= 0)
return sum_ranks (BASE_CONVERSION_BADNESS, rank);
- /* fall through */
+ [[fallthrough]];
default:
return INCOMPATIBLE_TYPE_BADNESS;
}