The Switch Has Been Made From C89 To C11/GNU11 With Linux 5.18
As we approach the end of the first week of the Linux 5.18 merge window, another note worthy pull request to land is the switching of the C language standard from GNU89 (C89) to GNU11 (C11).
Stemming from a list_for_each_entry() bug, upstream kernel developers including Linus Torvalds himself began discussing C version requirements for the kernel and the benefits of moving to a newer C standard. Since last year with Linux 5.15 the base compiler requirement was raised to GCC 5.1, it was deemed safe to go ahead and move from C89 to C11 without introducing any new compiler requirements.
So with Linux 5.18 the jump was made from C89 straight to C11 without first using C99 as a stepping stone. The Linux kernel continues using the GNU dialect of the ISO C standard. The Linux kernel has already enabled some newer C extensions previously while now for kernel code it's safe to assume "-std=gnu11" moving forward.
More details via this Git merge.
Stemming from a list_for_each_entry() bug, upstream kernel developers including Linus Torvalds himself began discussing C version requirements for the kernel and the benefits of moving to a newer C standard. Since last year with Linux 5.15 the base compiler requirement was raised to GCC 5.1, it was deemed safe to go ahead and move from C89 to C11 without introducing any new compiler requirements.
So with Linux 5.18 the jump was made from C89 straight to C11 without first using C99 as a stepping stone. The Linux kernel continues using the GNU dialect of the ISO C standard. The Linux kernel has already enabled some newer C extensions previously while now for kernel code it's safe to assume "-std=gnu11" moving forward.
More details via this Git merge.
5 Comments