aboutsummaryrefslogtreecommitdiffstats
path: root/misc-utils/findmnt.c
diff options
context:
space:
mode:
authorMatteo Croce <teknoraver@meta.com>2025-03-27 20:49:10 +0100
committerMatteo Croce <teknoraver@meta.com>2025-04-07 15:09:08 +0200
commitb77025b6e78efbdd4cc36c5e65d3a8d59a805e63 (patch)
treef959a170db497beb257ea6aedeed5208edfdce76 /misc-utils/findmnt.c
parent1a3cbd3c0f7c84f977b624a6240d02ce741fc747 (diff)
downloadutil-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 'misc-utils/findmnt.c')
-rw-r--r--misc-utils/findmnt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 46955fc227..540c27fc2d 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -638,7 +638,7 @@ static char *get_data(struct libmnt_fs *fs, int num, size_t *datasiz, struct fin
if (str)
break;
- /* fallthrough */
+ FALLTHROUGH;
case COL_SOURCE:
{
const char *root = mnt_fs_get_root(fs);
@@ -1493,7 +1493,7 @@ static int get_column_json_type(int id, int scols_flags, int *multi, unsigned in
*multi = 1;
if (!(findmnt_flags & FL_BYTES))
break;
- /* fallthrough */
+ FALLTHROUGH;
case COL_ID:
case COL_UNIQ_ID:
case COL_PARENT:
@@ -1982,7 +1982,7 @@ int main(int argc, char *argv[])
break;
case 'M':
findmnt.flags |= FL_STRICTTARGET;
- /* fallthrough */
+ FALLTHROUGH;
case 'T':
set_match(COL_TARGET, optarg);
findmnt.flags |= FL_NOSWAPMATCH;