From 68a71ed3f65441f564ab5fd6f7f366db67008f3a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 14 Nov 2022 07:33:48 +0100 Subject: [PATCH] BUILD: vars: use __fallthrough in var_accounting_{diff,add}() This avoids 6 build warnings when preprocessing happens before compiling with gcc >= 7. --- src/vars.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vars.c b/src/vars.c index e620acf3a..0b6bc1212 100644 --- a/src/vars.c +++ b/src/vars.c @@ -90,7 +90,7 @@ void var_accounting_diff(struct vars *vars, struct session *sess, struct stream case SCOPE_RES: if (var_reqres_limit && strm) _HA_ATOMIC_ADD(&strm->vars_reqres.size, size); - /* fall through */ + __fallthrough; case SCOPE_TXN: if (var_txn_limit && strm) _HA_ATOMIC_ADD(&strm->vars_txn.size, size); @@ -102,12 +102,12 @@ void var_accounting_diff(struct vars *vars, struct session *sess, struct stream if (check) _HA_ATOMIC_ADD(&check->vars.size, size); } - /* fall through */ scope_sess: + __fallthrough; case SCOPE_SESS: if (var_sess_limit) _HA_ATOMIC_ADD(&sess->vars.size, size); - /* fall through */ + __fallthrough; case SCOPE_PROC: if (var_proc_limit || var_global_limit) _HA_ATOMIC_ADD(&proc_vars.size, size); @@ -128,7 +128,7 @@ static int var_accounting_add(struct vars *vars, struct session *sess, struct st case SCOPE_RES: if (var_reqres_limit && strm && strm->vars_reqres.size + size > var_reqres_limit) return 0; - /* fall through */ + __fallthrough; case SCOPE_TXN: if (var_txn_limit && strm && strm->vars_txn.size + size > var_txn_limit) return 0; @@ -139,12 +139,12 @@ static int var_accounting_add(struct vars *vars, struct session *sess, struct st if (var_check_limit && check && check->vars.size + size > var_check_limit) return 0; } - /* fall through */ scope_sess: + __fallthrough; case SCOPE_SESS: if (var_sess_limit && sess->vars.size + size > var_sess_limit) return 0; - /* fall through */ + __fallthrough; case SCOPE_PROC: /* note: scope proc collects all others and is currently identical to the * global limit.