]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: map: use __fallthrough in cli_io_handler_*()
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 06:35:24 +0000 (07:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 10:14:02 +0000 (11:14 +0100)
This avoids 6 build warnings when preprocessing happens before compiling
with gcc >= 7.

src/map.c

index 52ddb5c7fcf128949f00d197357b3367d3dc1e2c..46125ad9b33cf34cb841a9f2013d781ffb7751eb 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -363,7 +363,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
        switch (ctx->state) {
        case STATE_INIT:
                ctx->state = STATE_LIST;
-               /* fall through */
+               __fallthrough;
 
        case STATE_LIST:
                HA_SPIN_LOCK(PATREF_LOCK, &ctx->ref->lock);
@@ -405,7 +405,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
                        ctx->bref.ref = elt->list.n;
                }
                HA_SPIN_UNLOCK(PATREF_LOCK, &ctx->ref->lock);
-               /* fall through */
+               __fallthrough;
 
        default:
                ctx->state = STATE_DONE;
@@ -437,7 +437,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                ctx->ref = pat_list_get_next(ctx->ref, &pattern_reference,
                                                        ctx->display_flags);
                ctx->state = STATE_LIST;
-               /* fall through */
+               __fallthrough;
 
        case STATE_LIST:
                while (ctx->ref) {
@@ -463,7 +463,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                                                                ctx->display_flags);
                }
 
-               /* fall through */
+               __fallthrough;
 
        default:
                ctx->state = STATE_DONE;
@@ -485,7 +485,7 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
                ctx->expr = LIST_ELEM(&ctx->ref->pat, struct pattern_expr *, list);
                ctx->expr = pat_expr_get_next(ctx->expr, &ctx->ref->pat);
                ctx->state = STATE_LIST;
-               /* fall through */
+               __fallthrough;
 
        case STATE_LIST:
                HA_SPIN_LOCK(PATREF_LOCK, &ctx->ref->lock);
@@ -583,7 +583,7 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
                                                                 &ctx->ref->pat);
                }
                HA_SPIN_UNLOCK(PATREF_LOCK, &ctx->ref->lock);
-               /* fall through */
+               __fallthrough;
 
        default:
                ctx->state = STATE_DONE;