diff options
| author | Matteo Croce <teknoraver@meta.com> | 2025-03-27 20:49:10 +0100 |
|---|---|---|
| committer | Matteo Croce <teknoraver@meta.com> | 2025-04-07 15:09:08 +0200 |
| commit | b77025b6e78efbdd4cc36c5e65d3a8d59a805e63 (patch) | |
| tree | f959a170db497beb257ea6aedeed5208edfdce76 /sys-utils | |
| parent | 1a3cbd3c0f7c84f977b624a6240d02ce741fc747 (diff) | |
| download | util-linux-b77025b6e78efbdd4cc36c5e65d3a8d59a805e63.tar.gz | |
Use the 'fallthrough' attribute
C23[1] and CPP17[2] introduced the 'fallthrough' attribute to let the
compiler know that we're intentionally falling through a case statement.
This suppress a warning with new compilers when doing an implicit fallthrough.
[1] https://en.cppreference.com/w/c/language/attributes/fallthrough
[2] https://en.cppreference.com/w/cpp/language/attributes/fallthrough
Diffstat (limited to 'sys-utils')
| -rw-r--r-- | sys-utils/dmesg.c | 2 | ||||
| -rw-r--r-- | sys-utils/flock.c | 2 | ||||
| -rw-r--r-- | sys-utils/ipcrm.c | 6 | ||||
| -rw-r--r-- | sys-utils/lsipc.c | 2 | ||||
| -rw-r--r-- | sys-utils/lsmem.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index dc9a2877ab..0fdfc3c63b 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1928,7 +1928,7 @@ int main(int argc, char *argv[]) ; else break; - /* fallthrough */ + FALLTHROUGH; case SYSLOG_ACTION_CLEAR: if (klogctl(SYSLOG_ACTION_CLEAR, NULL, 0) < 0) err(EXIT_FAILURE, _("clear kernel buffer failed")); diff --git a/sys-utils/flock.c b/sys-utils/flock.c index 7042b75d1e..6e58a1d516 100644 --- a/sys-utils/flock.c +++ b/sys-utils/flock.c @@ -405,7 +405,7 @@ int main(int argc, char *argv[]) if (open_flags & O_RDWR) break; } - /* fallthrough */ + FALLTHROUGH; default: /* Other errors */ if (filename) diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c index 8ddb104f44..5e9fa4b576 100644 --- a/sys-utils/ipcrm.c +++ b/sys-utils/ipcrm.c @@ -448,7 +448,7 @@ int main(int argc, char **argv) ret++; break; } - /* fallthrough */ + FALLTHROUGH; case 'm': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); @@ -462,7 +462,7 @@ int main(int argc, char **argv) ret++; break; } - /* fallthrough */ + FALLTHROUGH; case 'q': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); @@ -476,7 +476,7 @@ int main(int argc, char **argv) ret++; break; } - /* fallthrough */ + FALLTHROUGH; case 's': if (!iskey) id = strtos32_or_err(optarg, _("failed to parse argument")); diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c index 7b041790ba..d1dd27f354 100644 --- a/sys-utils/lsipc.c +++ b/sys-utils/lsipc.c @@ -403,7 +403,7 @@ static struct libscols_table *new_table(struct lsipc_control *ctl) switch(ctl->outmode) { case OUT_NEWLINE: scols_table_set_column_separator(table, "\n"); - /* fallthrough */ + FALLTHROUGH; case OUT_EXPORT: scols_table_enable_export(table, 1); break; diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c index 2b79114113..f36e2b1e30 100644 --- a/sys-utils/lsmem.c +++ b/sys-utils/lsmem.c @@ -725,7 +725,7 @@ int main(int argc, char **argv) case COL_SIZE: if (!lsmem->bytes) break; - /* fallthrough */ + FALLTHROUGH; case COL_NODE: scols_column_set_json_type(cl, SCOLS_JSON_NUMBER); break; |
