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 /disk-utils/sfdisk.c | |
| 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 'disk-utils/sfdisk.c')
| -rw-r--r-- | disk-utils/sfdisk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 94ef6d0150..41b5558ead 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -2095,7 +2095,7 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv) break; } } - /* fallthrough */ + FALLTHROUGH; case SFDISK_DONE_WRITE: rc = write_changes(sf); break; @@ -2334,7 +2334,7 @@ int main(int argc, char *argv[]) break; case 'J': sf->json = 1; - /* fallthrough */ + FALLTHROUGH; case 'd': sf->act = ACT_DUMP; break; @@ -2346,7 +2346,7 @@ int main(int argc, char *argv[]) break; case 'G': warnx(_("--show-pt-geometry is no more implemented. Using --show-geometry.")); - /* fallthrough */ + FALLTHROUGH; case 'g': sf->act = ACT_SHOW_GEOM; break; |
