Linux 5.3 Enables "-Wimplicit-fallthrough" Compiler Flag
The recent work on enabling "-Wimplicit-fallthrough" behavior for the Linux kernel has culminated in Linux 5.3 with actually being able to universally enable this compiler feature.
The -Wimplicit-fallthrough flag on GCC7 and newer warns of cases where switch case fall-through behavior could lead to potential bugs / unexpected behavior.
Gustavo A. R. Silva who took on this initiative to enable the implicit-fallthrough warning for the Linux kernel had to first go through the kernel's thousands of switch statements in evaluating their behavior to ensure any fall-throughs were expected and not leading to potentially unexpected behavior.
After evaluating all of the current warnings generated and marking the current fall-throughs as safe, the flag is now set universally when building the Linux kernel.
That batch of work can be found via this pull request for the Linux 5.3 merge window.
The -Wimplicit-fallthrough flag on GCC7 and newer warns of cases where switch case fall-through behavior could lead to potential bugs / unexpected behavior.
Gustavo A. R. Silva who took on this initiative to enable the implicit-fallthrough warning for the Linux kernel had to first go through the kernel's thousands of switch statements in evaluating their behavior to ensure any fall-throughs were expected and not leading to potentially unexpected behavior.
After evaluating all of the current warnings generated and marking the current fall-throughs as safe, the flag is now set universally when building the Linux kernel.
That batch of work can be found via this pull request for the Linux 5.3 merge window.
7 Comments