From: Willy Tarreau Date: Mon, 14 Nov 2022 05:59:59 +0000 (+0100) Subject: BUILD: sample: use __fallthrough in smp_is_rw() and smp_dup() X-Git-Tag: v2.7-dev9~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ed0597ce893feccc8c2f0513a7a37d258239a93;p=thirdparty%2Fhaproxy.git BUILD: sample: use __fallthrough in smp_is_rw() and smp_dup() This avoids three build warnings when preprocessing happens before compiling with gcc >= 7. --- diff --git a/include/haproxy/sample.h b/include/haproxy/sample.h index 9ec4df16d1..14d1a06231 100644 --- a/include/haproxy/sample.h +++ b/include/haproxy/sample.h @@ -99,7 +99,7 @@ int smp_is_safe(struct sample *smp) case SMP_T_METH: if (smp->data.u.meth.meth != HTTP_METH_OTHER) return 1; - /* Fall through */ + __fallthrough; case SMP_T_STR: if (!smp->data.u.str.size || smp->data.u.str.data >= smp->data.u.str.size) @@ -149,7 +149,7 @@ int smp_is_rw(struct sample *smp) case SMP_T_METH: if (smp->data.u.meth.meth != HTTP_METH_OTHER) return 1; - /* Fall through */ + __fallthrough; case SMP_T_STR: if (!smp->data.u.str.size || diff --git a/src/sample.c b/src/sample.c index cd9fccf85e..a3acfef143 100644 --- a/src/sample.c +++ b/src/sample.c @@ -823,7 +823,7 @@ int smp_dup(struct sample *smp) case SMP_T_METH: if (smp->data.u.meth.meth != HTTP_METH_OTHER) break; - /* Fall through */ + __fallthrough; case SMP_T_STR: trash = get_trash_chunk();