From: Willy Tarreau Date: Mon, 14 Nov 2022 06:35:24 +0000 (+0100) Subject: BUILD: map: use __fallthrough in cli_io_handler_*() X-Git-Tag: v2.7-dev9~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab42dc33581929ce9936ce4ab43fd7d2849c227f;p=thirdparty%2Fhaproxy.git BUILD: map: use __fallthrough in cli_io_handler_*() This avoids 6 build warnings when preprocessing happens before compiling with gcc >= 7. --- diff --git a/src/map.c b/src/map.c index 52ddb5c7fc..46125ad9b3 100644 --- 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;