diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-11-30 15:59:16 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-11-30 23:16:39 -0500 |
commit | a521809d9b182d2863e2b0cf69270d1cef1da507 (patch) | |
tree | 646622696a147ca887fc0556fbe0fefa6e20ccdd | |
parent | 2b33b0d960076b1186bcc454a9627a5451dca17a (diff) | |
download | gdb-a521809d9b182d2863e2b0cf69270d1cef1da507.zip gdb-a521809d9b182d2863e2b0cf69270d1cef1da507.tar.gz gdb-a521809d9b182d2863e2b0cf69270d1cef1da507.tar.bz2 |
gdb: fix warnings about invalid [[fallthrough]] usage
Fix these two warnings, when building on macos:
CXX cp-name-parser.o
/Users/smarchi/src/binutils-gdb/gdb/cp-name-parser.y:1644:7: error: fallthrough annotation does not directly precede switch label
[[fallthrough]];
^
CXX dbxread.o
/Users/smarchi/src/binutils-gdb/gdb/dbxread.c:2809:7: error: fallthrough annotation does not directly precede switch label
[[fallthrough]];
^
In these two cases, we [[fallthrough]], followed by a regular label,
followed by a case label. Move the [[fallthrough]] below the regular
label.
Change-Id: If4a3145139e050bdb6950c7f239badd5778e6f64
Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r-- | gdb/cp-name-parser.y | 2 | ||||
-rw-r--r-- | gdb/dbxread.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 9a359d4..6f9305e 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -1641,9 +1641,9 @@ yylex (YYSTYPE *lvalp, cpname_state *state) state->lexptr++; return '-'; } - [[fallthrough]]; try_number: + [[fallthrough]]; case '0': case '1': case '2': diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 99d9fba..ebfd48e 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2806,9 +2806,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, case N_NBSTS: case N_NBLCS: unknown_symtype_complaint (hex_string (type)); - [[fallthrough]]; define_a_symbol: + [[fallthrough]]; /* These symbol types don't need the address field relocated, since it is either unused, or is absolute. */ case N_GSYM: /* Global variable. */ |