Linux 5.15 will enable “-Werror” for all kernel builds by default

Linus Torvalds submitted and incorporated a change to Linux 5.15 to enable the “-Werror” compiler flag for all kernel builds by default. The “-Werror” compiler flag treats all warnings as build errors, thereby forcing developers to pay attention to some build warnings that may be ignored at ordinary times, and give priority to them because they will interrupt the build process. Many software projects now use “-Werror” by default to strengthen quality control to ensure that warnings are resolved, but most of them have not reached the scale of the Linux kernel.
Zonefs Linux file system

Linus pointed out in the submission that the construction of the kernel should not cause any compiler warnings. At the same time, this patch adds WERROR as a Kconfig switch, which controls whether to enable the “-Werror” flag, which is turned on by default. However, if the new compiler version introduces new warnings and the kernel cannot fix them immediately, you can also disable the “-Werror” flag at this time.

Finally, Linus expressed the hope that this feature can reduce the pull requests it receives because many of these requests are warnings that have not been noticed by the automated process.