]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: sample: use __fallthrough in smp_is_rw() and smp_dup()
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 05:59:59 +0000 (06:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 10:14:02 +0000 (11:14 +0100)
This avoids three build warnings when preprocessing happens before compiling
with gcc >= 7.

include/haproxy/sample.h
src/sample.c

index 9ec4df16d1479a6cca263035ae51befe882f6baf..14d1a062314404c65d9ea6530ef01624ed49c281 100644 (file)
@@ -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 ||
index cd9fccf85e3a786ba706ef47859923102f926af8..a3acfef143cb42707cee4abb22b5cc86494c717f 100644 (file)
@@ -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();