From: Yonghong Song Date: Tue, 6 Oct 2020 04:34:27 +0000 (-0700) Subject: samples/bpf: Fix a compilation error with fallthrough marking X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=544d6adf3c3dddbf80e5757a3098c63612f5f8f8;p=linux.git samples/bpf: Fix a compilation error with fallthrough marking Compiling samples/bpf hits an error related to fallthrough marking. ... CC samples/bpf/hbm.o samples/bpf/hbm.c: In function ‘main’: samples/bpf/hbm.c:486:4: error: ‘fallthrough’ undeclared (first use in this function) fallthrough; ^~~~~~~~~~~ The "fallthrough" is not defined under tools/include directory. Rather, it is "__fallthrough" is defined in linux/compiler.h. Including "linux/compiler.h" and using "__fallthrough" fixed the issue. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20201006043427.1891805-1-yhs@fb.com --- diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c index 4b22ace52f805..ff4c533dfac29 100644 --- a/samples/bpf/hbm.c +++ b/samples/bpf/hbm.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -483,7 +484,7 @@ int main(int argc, char **argv) "Option -%c requires an argument.\n\n", optopt); case 'h': - fallthrough; + __fallthrough; default: Usage(); return 0;