From 791082540963321ab2c6314567d883a937f54a6f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 14 Nov 2022 07:13:22 +0100 Subject: [PATCH] BUILD: peers: use __fallthrough in peer_io_handler() This avoids 7 build warnings when preprocessing happens before compiling with gcc >= 7. --- src/peers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/peers.c b/src/peers.c index 8477c43e3..f9dabf7c0 100644 --- a/src/peers.c +++ b/src/peers.c @@ -2942,7 +2942,7 @@ switchstate: prev_state = appctx->st0; appctx->svcctx = NULL; appctx->st0 = PEER_SESS_ST_GETVERSION; - /* fall through */ + __fallthrough; case PEER_SESS_ST_GETVERSION: prev_state = appctx->st0; reql = peer_getline_version(appctx, &maj_ver, &min_ver); @@ -2953,7 +2953,7 @@ switchstate: } appctx->st0 = PEER_SESS_ST_GETHOST; - /* fall through */ + __fallthrough; case PEER_SESS_ST_GETHOST: prev_state = appctx->st0; reql = peer_getline_host(appctx); @@ -2964,7 +2964,7 @@ switchstate: } appctx->st0 = PEER_SESS_ST_GETPEER; - /* fall through */ + __fallthrough; case PEER_SESS_ST_GETPEER: { prev_state = appctx->st0; reql = peer_getline_last(appctx, &curpeer); @@ -3006,7 +3006,7 @@ switchstate: appctx->st0 = PEER_SESS_ST_SENDSUCCESS; _HA_ATOMIC_INC(&active_peers); } - /* fall through */ + __fallthrough; case PEER_SESS_ST_SENDSUCCESS: { prev_state = appctx->st0; if (!curpeer) { @@ -3053,7 +3053,7 @@ switchstate: /* switch to the waiting statuscode state */ appctx->st0 = PEER_SESS_ST_GETSTATUS; } - /* fall through */ + __fallthrough; case PEER_SESS_ST_GETSTATUS: { prev_state = appctx->st0; if (!curpeer) { @@ -3096,7 +3096,7 @@ switchstate: _HA_ATOMIC_INC(&connected_peers); appctx->st0 = PEER_SESS_ST_WAITMSG; } - /* fall through */ + __fallthrough; case PEER_SESS_ST_WAITMSG: { uint32_t msg_len = 0; char *msg_cur = trash.area; @@ -3186,7 +3186,7 @@ send_msgs: appctx->st0 = PEER_SESS_ST_END; prev_state = appctx->st0; } - /* fall through */ + __fallthrough; case PEER_SESS_ST_END: { if (prev_state == PEER_SESS_ST_WAITMSG) _HA_ATOMIC_DEC(&connected_peers);