]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Use the 'fallthrough' attribute
authorMatteo Croce <teknoraver@meta.com>
Thu, 27 Mar 2025 19:49:10 +0000 (20:49 +0100)
committerMatteo Croce <teknoraver@meta.com>
Mon, 7 Apr 2025 13:09:08 +0000 (15:09 +0200)
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

36 files changed:
disk-utils/cfdisk.c
disk-utils/fdisk-menu.c
disk-utils/mkfs.minix.c
disk-utils/sfdisk.c
lib/pty-session.c
libblkid/src/topology/md.c
libmount/src/context_mount.c
libsmartcols/src/calculate.c
libsmartcols/src/print.c
login-utils/last.c
login-utils/lslogins.c
login-utils/su-common.c
login-utils/sulogin.c
lsfd-cmd/bdev.c
lsfd-cmd/cdev.c
lsfd-cmd/file.c
lsfd-cmd/sock-xinfo.c
lsfd-cmd/sock.c
lsfd-cmd/unkn.c
misc-utils/cal.c
misc-utils/fincore.c
misc-utils/findmnt.c
misc-utils/lsblk.c
misc-utils/lslocks.c
schedutils/uclampset.c
sys-utils/dmesg.c
sys-utils/flock.c
sys-utils/ipcrm.c
sys-utils/lsipc.c
sys-utils/lsmem.c
term-utils/agetty.c
term-utils/script.c
text-utils/hexdump-parse.c
text-utils/more.c
text-utils/pg.c
text-utils/ul.c

index e8a8b959a0f95ef7c4e5aa3d14aeec9f91aedf0b..594dacaacf0b440cb727e475e7055d338fe52877 100644 (file)
@@ -1580,7 +1580,7 @@ static int ui_menu_move(struct cfdisk *cf, int key)
                                ui_menu_goto(cf, (int) m->idx - m->page_sz);
                                return 0;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                case KEY_HOME:
                        ui_menu_goto(cf, 0);
                        return 0;
@@ -1589,7 +1589,7 @@ static int ui_menu_move(struct cfdisk *cf, int key)
                                ui_menu_goto(cf, m->idx + m->page_sz);
                                return 0;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                case KEY_END:
                        ui_menu_goto(cf, m->nitems);
                        return 0;
@@ -2671,7 +2671,7 @@ static int ui_run(struct cfdisk *cf)
                                ui_table_goto(cf, (int) cf->lines_idx - cf->page_sz);
                                break;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                case KEY_HOME:
                        ui_table_goto(cf, 0);
                        break;
@@ -2680,7 +2680,7 @@ static int ui_run(struct cfdisk *cf)
                                ui_table_goto(cf, cf->lines_idx + cf->page_sz);
                                break;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                case KEY_END:
                        ui_table_goto(cf, (int) cf->nlines - 1);
                        break;
index 4e5801bce601161e56d3d922a46214a122597847..707394d4e8d97d84879b062e12a8666165cef019 100644 (file)
@@ -620,7 +620,7 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
                        rc = fdisk_reread_partition_table(cxt);
                if (!rc)
                        rc = fdisk_deassign_device(cxt, 0);
-               /* fallthrough */
+               FALLTHROUGH;
        case 'q':
                fdisk_unref_context(cxt);
                fputc('\n', stdout);
index 328dc8887d165397d9e6a571b66e3d2e03b9d960..110e5a0afa6b9a5f35a72c5563d637551c4dd4a8 100644 (file)
@@ -780,7 +780,7 @@ int main(int argc, char ** argv)
                        break;
                case 'v': /* kept for backwards compatibility */
                        warnx(_("-v is ambiguous, use '-2' instead"));
-                       /* fallthrough */
+                       FALLTHROUGH;
                case '2':
                        fs_version = 2;
                        break;
index 94ef6d0150a7465687917b7d9260905f74bf1886..41b5558ead7e864bfdd9b6cd330e42ca03c02d97 100644 (file)
@@ -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;
index 815264d1a90e7103ed53d299b8ded3ab88b0bcdd..e9db4988bbaff6823987a8fb76b1b2d71e60d5db 100644 (file)
@@ -586,11 +586,11 @@ static int handle_signal(struct ul_pty *pty, int fd)
                }
                break;
        case SIGHUP:
-               /* fallthrough */
+               FALLTHROUGH;
        case SIGTERM:
-               /* fallthrough */
+               FALLTHROUGH;
        case SIGINT:
-               /* fallthrough */
+               FALLTHROUGH;
        case SIGQUIT:
                DBG(SIG, ul_debugobj(pty, " get signal SIG{TERM,INT,QUIT}"));
                pty->delivered_signal = info.ssi_signo;
index 02f27a8c49782dd699fcfe3d83c4ce356bb905d7..b9e7d792f2b0e32bcb611dae49dcc801fe0bc71a 100644 (file)
@@ -121,11 +121,11 @@ static int probe_md_tp(blkid_probe pr,
        switch (md.level) {
        case 6:
                md.raid_disks--;
-               /* fallthrough */
+               FALLTHROUGH;
        case 5:
        case 4:
                md.raid_disks--;
-               /* fallthrough */
+               FALLTHROUGH;
        case 1:
        case 0:
        case 10:
index fbb20070812bc5a29e8f354ece4d306e540c341b..14ff9ba13a805547489a63d5c988ac5fd810a4f1 100644 (file)
@@ -1833,7 +1833,7 @@ int mnt_context_get_mount_excode(
                        snprintf(buf, bufsz, _("cannot mount; probably corrupted filesystem on %s"), src);
                        break;
                }
-               /* fallthrough */
+               FALLTHROUGH;
 
        default:
        generic_error:
index 77e843397b26e147631a1c83feea9ab347bba283..30d67c14965e5e385a7ee2eb8f9399314daaddd3 100644 (file)
@@ -344,7 +344,7 @@ static int reduce_column(struct libscols_table *tb,
                /* reduce extreme columns with large width deviation */
                if (st->width_deviation < st->width_avg / 2.0)
                        break;
-               /* fallthrough */
+               FALLTHROUGH;
        case 2:
                /* reduce extreme columns */
                if (!scols_column_is_noextremes(cl))
@@ -356,7 +356,7 @@ static int reduce_column(struct libscols_table *tb,
                /* reduce columns with trunc flag and relative whint and large width deviation */
                if (st->width_deviation < st->width_avg / 2.0)
                        break;
-               /* fallthrough */
+               FALLTHROUGH;
        case 4:
                /* reduce columns with trunc flag and relative whint */
                if (!is_trunc)
@@ -372,7 +372,7 @@ static int reduce_column(struct libscols_table *tb,
                /* reduce all columns with trunc flag large width deviation */
                if (st->width_deviation < st->width_avg / 2.2)
                        break;
-               /* fallthrough */
+               FALLTHROUGH;
        case 6:
                /* reduce all columns with trunc flag */
                if (!is_trunc && !scols_column_is_noextremes(cl))
index 4432def6135376a24ccc81c213368379fd46cb6a..cd2aa96113ce86903a8e6d1396b10e4884efd3f8 100644 (file)
@@ -1281,7 +1281,7 @@ int __scols_initialize_printing(struct libscols_table *tb, struct ul_buffer *buf
        case SCOLS_FMT_JSON:
                ul_jsonwrt_init(&tb->json, tb->out, 0);
                extra_bufsz += tb->nlines * 3;          /* indentation */
-               /* fallthrough */
+               FALLTHROUGH;
        case SCOLS_FMT_EXPORT:
        {
                struct libscols_column *cl;
index b7dff30c6729a58ccde5e89e941e10fa98999606..9bf7868459047b33379ac909bad10bf842255957 100644 (file)
@@ -866,7 +866,7 @@ static void process_wtmp_file(const struct last_control *ctl,
                                        c = whydown;
                                quit = list(ctl, &ut, lastboot, c);
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
 
                case DEAD_PROCESS:
                        /*
index 88b0c4b316d69abf872f12f1a93e9ccb3176a47d..b7f10667eec19477ede07d593949c432e3824d17 100644 (file)
@@ -1208,13 +1208,13 @@ static struct libscols_table *setup_table(struct lslogins_control *ctl)
                break;
        case OUT_NEWLINE:
                scols_table_set_column_separator(table, "\n");
-               /* fallthrough */
+               FALLTHROUGH;
        case OUT_EXPORT:
                scols_table_enable_export(table, 1);
                break;
        case OUT_NUL:
                scols_table_set_line_separator(table, "\0");
-               /* fallthrough */
+               FALLTHROUGH;
        case OUT_RAW:
                scols_table_enable_raw(table, 1);
                break;
index 8a77cf2a806158373e875993f1b48073c666e9e7..cf10caa6f42bd2d21d7895fff7cc5a9eb3628a22 100644 (file)
@@ -1154,7 +1154,7 @@ int su_main(int argc, char **argv, int mode)
                                errx(EXIT_FAILURE, _("no command was specified"));
                        break;
                }
-               /* fallthrough */
+               FALLTHROUGH;
        case SU_MODE:
                if (optind < argc)
                        su->new_user = argv[optind++];
index aeaa3f11f61c5dac2f7bd8f2640c4aa198292bbb..cfc642070179181886d92ee90ba754799bffcac1 100644 (file)
@@ -401,11 +401,11 @@ static void tcfinal(struct console *con)
                break;
        case 1:                         /* odd parity */
                tio->c_cflag |= PARODD;
-               /* fallthrough */
+               FALLTHROUGH;
        case 2:                         /* even parity */
                tio->c_cflag |= PARENB;
                tio->c_iflag |= (INPCK | ISTRIP);
-               /* fallthrough */
+               FALLTHROUGH;
        case (1 | 2):                   /* no parity bit */
                tio->c_cflag &= ~CSIZE;
                tio->c_cflag |= CS7;
@@ -796,7 +796,7 @@ static char *getpasswd(struct console *con)
                        switch (errno) {
                        case EIO:
                                con->flags |= CON_EIO;
-                               /* fallthrough */
+                               FALLTHROUGH;
                        default:
                                warn(_("cannot read %s"), con->tty);
                                break;
@@ -1241,7 +1241,7 @@ int main(int argc, char **argv)
                        exit(0);
                case -1:
                        warn(_("fork failed"));
-                       /* fallthrough */
+                       FALLTHROUGH;
                default:
                        break;
                }
index 0da71301acbcd4a2bb99cd3fad135b20ea2876fb..fc1bb68807d8763fca83ca3da2d7af54c960f1ec 100644 (file)
@@ -70,7 +70,7 @@ static bool bdev_fill_column(struct proc *proc __attribute__((__unused__)),
                                  minor(file->stat.st_rdev));
                        break;
                }
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_MAJMIN:
                xasprintf(&str, "%u:%u",
                          major(file->stat.st_rdev),
index 9b0663e761bae0a76bdc6d68a51e9b13a9ac23ac..0f4d34fe716193cf1514999d1ad2ed5ae0078ad9 100644 (file)
@@ -307,7 +307,7 @@ static bool cdev_generic_fill_column(struct proc *proc  __attribute__((__unused_
                                  minor(file->stat.st_rdev));
                        return true;
                }
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_MAJMIN:
                xasprintf(str, "%u:%u",
                          major(file->stat.st_rdev),
index 32b08693db20b4c1c491d8afb5560f381ce0195f..841991e6e54cbf641382cf83277e85006405f985 100644 (file)
@@ -148,7 +148,7 @@ static bool abst_fill_column(struct proc *proc,
        case COL_FD:
                if (!is_opened_file(file))
                        return false;
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_ASSOC:
                if (is_opened_file(file))
                        xasprintf(&str, "%d", file->association);
@@ -432,7 +432,7 @@ static bool file_fill_column(struct proc *proc __attribute__((__unused__)),
                                return true;
                        }
                }
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_KNAME:
                if (file->name
                    && scols_line_set_data(ln, column_index, file->name))
index cac936ccde099d5a2773b17607f5f09a53116341..be1da8d2889fa080fd8be1708d5f0d185547e122 100644 (file)
@@ -1157,7 +1157,7 @@ static bool tcp_get_listening(struct sock_xinfo *sock_xinfo,
                        n = class->get_addr(l4, L4_LOCAL);              \
                        has_laddr = true;                               \
                        p = tcp->local_port;                            \
-                       /* FALL THROUGH */                              \
+                       FALLTHROUGH;                                    \
                case COL_##L4##_RADDR:                                  \
                        if (!has_laddr) {                               \
                                n = class->get_addr(l4, L4_REMOTE);     \
@@ -1173,7 +1173,7 @@ static bool tcp_get_listening(struct sock_xinfo *sock_xinfo,
                case COL_##L4##_LPORT:                                  \
                        p = tcp->local_port;                            \
                        has_lport = true;                               \
-                       /* FALL THROUGH */                              \
+                       FALLTHROUGH;                                    \
                case COL_##L4##_RPORT:                                  \
                        if (!has_lport)                                 \
                                p = tcp->remote_port;                   \
index b6eb5fdfeeb105838746e5bb941792f1e3b4421e..db789bbb346d6ea52a014c1816eb6ae6251299eb 100644 (file)
@@ -69,7 +69,7 @@ static bool sock_fill_column(struct proc *proc __attribute__((__unused__)),
        case COL_TYPE:
                if (!sock->protoname)
                        return false;
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_SOCK_PROTONAME:
                if (sock->protoname)
                        if (scols_line_set_data(ln, column_index, sock->protoname))
index f604e6453279ca769b213663fc1822a7720ae979..76731d29147c4272916c9c5134919795e8889335 100644 (file)
@@ -99,7 +99,7 @@ static bool unkn_fill_column(struct proc *proc,
        case COL_TYPE:
                if (!unkn->anon_ops)
                        return false;
-               /* FALL THROUGH */
+               FALLTHROUGH;
        case COL_AINODECLASS:
                if (unkn->anon_ops) {
                        str = anon_get_class(unkn);
index 0acf042ff63ab68a9dd9257dd60bb587576fa281..0c36f8ef6bbd600227fb863826c6101798a745e4 100644 (file)
@@ -485,7 +485,7 @@ int main(int argc, char **argv)
                ctl.req.day = strtos32_or_err(*argv++, _("illegal day value"));
                if (ctl.req.day < 1 || DAYS_IN_MONTH < ctl.req.day)
                        errx(EXIT_FAILURE, _("illegal day value: use 1-%d"), DAYS_IN_MONTH);
-               /* fallthrough */
+               FALLTHROUGH;
        case 2:
                if (isdigit(**argv))
                        ctl.req.month = strtos32_or_err(*argv++, _("illegal month value: use 1-12"));
@@ -497,7 +497,7 @@ int main(int argc, char **argv)
                }
                if (ctl.req.month < 1 || MONTHS_IN_YEAR < ctl.req.month)
                        errx(EXIT_FAILURE, _("illegal month value: use 1-12"));
-               /* fallthrough */
+               FALLTHROUGH;
        case 1:
                ctl.req.year = strtos32_or_err(*argv++, _("illegal year value"));
                if (ctl.req.year < SMALLEST_YEAR)
index ea48f3e647dc7a55e720f9be0d8c4aa15f85b089..a2f2400521d1db61413aba89689bac7f742c98fc 100644 (file)
@@ -529,7 +529,7 @@ int main(int argc, char ** argv)
                        case COL_RES:
                                if (!ctl.bytes)
                                        break;
-                               /* fallthrough */
+                               FALLTHROUGH;
                        default:
                                scols_column_set_json_type(cl, SCOLS_JSON_NUMBER);
                                break;
index 46955fc2275949857cc77ec4a4c034bf79889f71..540c27fc2dbd624b19356c58d4b9afa8f326e8f9 100644 (file)
@@ -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;
index bd2621c026716bb931636d70d6b1ef9a8b37a2c7..9f252d079b05fe7838eb8949c2ed193e27a9be22 100644 (file)
@@ -2224,7 +2224,7 @@ static void set_column_type(const struct colinfo *ci, struct libscols_column *cl
                /* See init_scols_filter(), it may overwrite the type */
                if (!lsblk->bytes)
                        break;
-               /* fallthrough */
+               FALLTHROUGH;
        case COLTYPE_NUM:
                scols_column_set_json_type(cl, SCOLS_JSON_NUMBER);
                scols_column_set_data_type(cl, SCOLS_DATA_U64);
index a0017c4ca5afa6cd3c8a7c216dba8312d02c17ca..e5889020734154d80168875cea8b90104a49789e 100644 (file)
@@ -722,7 +722,7 @@ static int get_json_type_for_column(int column_id, int representing_in_bytes)
        case COL_SIZE:
                if (!representing_in_bytes)
                        return SCOLS_JSON_STRING;
-               /* fallthrough */
+               FALLTHROUGH;
        case COL_PID:
        case COL_START:
        case COL_END:
index eb3e449ff230101045f251d9c13939a4f63404fa..b1ae32b3dcaf4420a96d5005e130885d229fb21d 100644 (file)
@@ -268,7 +268,7 @@ int main(int argc, char **argv)
                        break;
                case 'V':
                        print_version(EXIT_SUCCESS);
-                       /* fallthrough */
+                       FALLTHROUGH;
                case 'h':
                        usage();
                default:
index dc9a2877ab5eb4a0ad91251e4a5259ab7c441015..0fdfc3c63bad1ef51563f8f1745c745a87707e2d 100644 (file)
@@ -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"));
index 7042b75d1e9a42eff72e1dffae435e389853ea54..6e58a1d5167da0805d4bdc02fdadc766bcad9fe4 100644 (file)
@@ -405,7 +405,7 @@ int main(int argc, char *argv[])
                                if (open_flags & O_RDWR)
                                        break;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                default:
                        /* Other errors */
                        if (filename)
index 8ddb104f44a7fcf3e916bbaf3ade15340e1c74a5..5e9fa4b576cb79dc1e76d40a67f4e42f905fc323 100644 (file)
@@ -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"));
index 7b041790ba1e91c64bc60f3cc1f0b1f135d22fe3..d1dd27f354ee31666241428d9fd8e4b2cf43e69c 100644 (file)
@@ -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;
index 2b79114113a0910cff777739a938651210584cbe..f36e2b1e300106ba4d8162a581c898583c32d2ad 100644 (file)
@@ -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;
index 0dfe52c900db817ec1a9144e49c6ac2262ed2e84..f65e511ca60e890054a9b93ba4c2b15a13f4dc0f 100644 (file)
@@ -2265,7 +2265,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
                                break;
                        case CTL('U'):
                                cp->kill = ascval;              /* set kill character */
-                               /* fallthrough */
+                               FALLTHROUGH;
                        case CTL('C'):
                                if (key == CTL('C') && !(op->flags & F_VCONSOLE))
                                        /* Ignore CTRL+C on serial line */
@@ -2375,12 +2375,12 @@ static void termio_final(struct options *op, struct termios *tp, struct chardata
        case 1:
                /* odd parity */
                tp->c_cflag |= PARODD;
-               /* fallthrough */
+               FALLTHROUGH;
        case 2:
                /* even parity */
                tp->c_cflag |= PARENB;
                tp->c_iflag |= INPCK | ISTRIP;
-               /* fallthrough */
+               FALLTHROUGH;
        case (1 | 2):
                /* no parity bit */
                tp->c_cflag &= ~CSIZE;
index 90070248d49c1b50b6dd5dfa518a05245ad5d433..05e3fc8762a6663478353803ac84a52389ebcd51 100644 (file)
@@ -712,9 +712,9 @@ static int callback_log_signal(void *data, struct signalfd_siginfo *info, void *
                break;
        }
        case SIGTERM:
-               /* fallthrough */
+               FALLTHROUGH;
        case SIGINT:
-               /* fallthrough */
+               FALLTHROUGH;
        case SIGQUIT:
                ssz = log_signal(ctl, info->ssi_signo, NULL);
                break;
index 23fffc86921d931b47da9a7bf36eca72ec398db7..018013e5eb3a753338650d5c1a7d82d35977e053 100644 (file)
@@ -355,7 +355,7 @@ isint:                              cs[3] = '\0';
                                        case 'A':
                                                endfu = fu;
                                                fu->flags |= F_IGNORE;
-                                               /* fallthrough */
+                                               FALLTHROUGH;
                                        case 'a':
                                                pr->flags = F_ADDRESS;
                                                ++p2;
index 2767bd77d022688c77ba9cb379ce58609ab66e3b..1ddfcaa4ceebda99888a9600ae7ad5308257a401 100644 (file)
@@ -1037,7 +1037,7 @@ static void ttyin(struct more_control *ctl, char buf[], int nmax, char pchar)
                                                case (size_t)-2:
                                                case (size_t)-1:
                                                        state = state_bak;
-                                                       /* fallthrough */
+                                                       FALLTHROUGH;
                                                case 0:
                                                        mblength = 1;
                                                }
@@ -1172,7 +1172,7 @@ static void expand(struct more_control *ctl, char *inbuf)
                                *outstr++ = *inpstr++;
                                break;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                default:
                        *outstr++ = c;
                }
@@ -1793,7 +1793,7 @@ static int more_key_command(struct more_control *ctl, char *filename)
                                break;
                        }
                        search_again = 1;
-                       /* fallthrough */
+                       FALLTHROUGH;
                case more_kc_search:
                        if (cmd.number == 0)
                                cmd.number++;
@@ -1860,7 +1860,7 @@ static int more_key_command(struct more_control *ctl, char *filename)
                                execute_editor(ctl, cmdbuf, sizeof(cmdbuf), filename);
                                break;
                        }
-                       /* fallthrough */
+                       FALLTHROUGH;
                default:
                        if (ctl->suppress_bell) {
                                erase_to_col(ctl, 0);
index 3623f3f787f8bc9411321f9ed1ed036c3ee3a628..d27f52ac60213e6bb48695c6ed60ec9686abb4f7 100644 (file)
@@ -658,7 +658,7 @@ static void prompt(long long pageno)
                                        break;
                                case SEARCH_FIN:
                                        state = SEARCH;
-                                       /* fallthrough */
+                                       FALLTHROUGH;
                                case SEARCH:
                                        if (cmd.cmdline[cmd.cmdlen - 1] == '\\') {
                                                escape = 1;
@@ -737,7 +737,7 @@ static void prompt(long long pageno)
                                        continue;
                                }
                                state = COUNT;
-                               /* fallthrough */
+                               FALLTHROUGH;
                        case COUNT:
                                break;
                        case ADDON_FIN:
index 8fa6428cd6f9d62f7cc57295861865359b0c9f92..d43f906d11e1a566e152ca115307879e42e7d395 100644 (file)
@@ -516,7 +516,7 @@ static void filter(struct ul_ctl *ctl, struct term_caps const *const tcs, FILE *
                        }
                        ctl->buf[ctl->column].c_char = '_';
                        ctl->buf[ctl->column].c_width = 1;
-                       /* fallthrough */
+                       FALLTHROUGH;
                case ' ':
                        set_column(ctl, ctl->column + 1);
                        continue;
@@ -617,7 +617,7 @@ int main(int argc, char **argv)
                break;
        default:
                warnx(_("trouble reading terminfo"));
-               /* fallthrough */
+               FALLTHROUGH;
        case 0:
                if (opt_terminal)
                        warnx(_("terminal `%s' is not known, defaulting to `dumb'"),