The Switch Has Been Made From C89 To C11/GNU11 With Linux 5.18

Written by Michael Larabel in Linux Kernel on 26 March 2022 at 06:05 AM EDT. 5 Comments
LINUX KERNEL
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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week