# git rev-parse -q --verify d936eb23874433caa3e3d841cfa16f5434b85dcf^{commit} d936eb23874433caa3e3d841cfa16f5434b85dcf already have revision, skipping fetch # git checkout -q -f -B kisskb d936eb23874433caa3e3d841cfa16f5434b85dcf # git clean -qxdf # < git log -1 # commit d936eb23874433caa3e3d841cfa16f5434b85dcf # Author: Linus Torvalds # Date: Thu Jul 15 18:05:31 2021 -0700 # # Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" # # This reverts commit b7eb335e26a9c7f258c96b3962c283c379d3ede0. # # It turns out that the problem with the clang -Wimplicit-fallthrough # warning is not about the kernel source code, but about clang itself, and # that the warning is unusable until clang fixes its broken ways. # # In particular, when you enable this warning for clang, you not only get # warnings about implicit fallthroughs. You also get this: # # warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough] # # which is completely broken becasue it # # (a) doesn't even tell you where the problem is (seriously: no line # numbers, no filename, no nothing). # # (b) is fundamentally broken anyway, because there are perfectly valid # reasons to have a fallthrough statement even if it turns out that # it can perhaps not be reached. # # In the kernel, an example of that second case is code in the scheduler: # # switch (state) { # case cpuset: # if (IS_ENABLED(CONFIG_CPUSETS)) { # cpuset_cpus_allowed_fallback(p); # state = possible; # break; # } # fallthrough; # case possible: # # where if CONFIG_CPUSETS is enabled you actually never hit the # fallthrough case at all. But that in no way makes the fallthrough # wrong. # # So the warning is completely broken, and enabling it for clang is a very # bad idea. # # In the meantime, we can keep the gcc option enabled, and make the gcc # build use # # -Wimplicit-fallthrough=5 # # which means that we will at least continue to require a proper # fallthrough statement, and that gcc won't silently accept the magic # comment versions. Because gcc does this all correctly, and while the odd # "=5" part is kind of obscure, it's documented in [1]: # # "-Wimplicit-fallthrough=5 doesn’t recognize any comments as # fallthrough comments, only attributes disable the warning" # # so if clang ever fixes its bad behavior we can try enabling it there again. # # Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [1] # Cc: Kees Cook # Cc: Gustavo A. R. Silva # Cc: Nathan Chancellor # Cc: Nick Desaulniers # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld --version # < git log --format=%s --max-count=1 d936eb23874433caa3e3d841cfa16f5434b85dcf # < make -s -j 32 ARCH=arm O=/kisskb/build/linus_omap2plus_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- omap2plus_defconfig # < make -s -j 32 ARCH=arm O=/kisskb/build/linus_omap2plus_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- help # make -s -j 32 ARCH=arm O=/kisskb/build/linus_omap2plus_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- olddefconfig # make -s -j 32 ARCH=arm O=/kisskb/build/linus_omap2plus_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- In file included from /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.4/plugin/include/tm.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:15, from /kisskb/src/scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3: /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.4/plugin/include/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.4/plugin/include/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.4/plugin/include/tm.h:44, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:15, from /kisskb/src/scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3: /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/4.9.4/plugin/include/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ cc1plus: warning: unrecognized command line option '-Wno-format-diag' /kisskb/src/arch/arm/crypto/ghash-ce-glue.c: In function 'ghash_do_update': /kisskb/src/arch/arm/crypto/ghash-ce-glue.c:67:44: warning: passing argument 4 of 'pmull_ghash_update_p64' from incompatible pointer type pmull_ghash_update_p64(blocks, dg, src, key->h, head); ^ /kisskb/src/arch/arm/crypto/ghash-ce-glue.c:45:17: note: expected 'const u64 (*)[2]' but argument is of type 'u64 (*)[2]' asmlinkage void pmull_ghash_update_p64(int blocks, u64 dg[], const char *src, ^ /kisskb/src/arch/arm/crypto/ghash-ce-glue.c:69:43: warning: passing argument 4 of 'pmull_ghash_update_p8' from incompatible pointer type pmull_ghash_update_p8(blocks, dg, src, key->h, head); ^ /kisskb/src/arch/arm/crypto/ghash-ce-glue.c:48:17: note: expected 'const u64 (*)[2]' but argument is of type 'u64 (*)[2]' asmlinkage void pmull_ghash_update_p8(int blocks, u64 dg[], const char *src, ^ /kisskb/src/net/sched/sch_frag.c: In function 'sch_fragment': /kisskb/src/net/sched/sch_frag.c:93:10: warning: missing braces around initializer [-Wmissing-braces] struct rtable sch_frag_rt = { 0 }; ^ /kisskb/src/net/sched/sch_frag.c:93:10: warning: (near initialization for 'sch_frag_rt.dst') [-Wmissing-braces] Completed OK # rm -rf /kisskb/build/linus_omap2plus_defconfig_arm-gcc4.9 # Build took: 0:04:02.392110