Linus Torvalds upgrades Linux kernel to more modern C11 standard

We all know that Linux is written in C language. What you probably do not know is that this operating system is based on one of the older C language standards, the 1989 version (C89). This standard is also known as ANSI X3.159-1989 or ANSI C. Linus Torvalds plans to upgrade the Linux kernel to the more modern 2011 C11 standard.

ZDNet notes that the Linux kernel transition from C89 to C11 is not as large as it seems. The C89 is still almost universally supported. Since each C compiler is compatible with previous versions, you will have no problem compiling or running C89-based applications. Therefore, a C11 compatible compiler will have no problem executing older C89 code.

This change of time was noticed by Torvalds, who, in order to correct a potential security problem with the execution of the initial guess functions of the nuclear link list, revealed another problem in the security patch. While resolving this issue, Torvalds realized that the duplicate sent to the macros of the preview list in C99 should be declared in the out-of-circle range.

Torolds said of the Linux kernel mailing list (LKML):

The whole reason this kind of unbelievable bug might occur is that, historically, we did not have C99-style “declare variable in loop” variables. Thus, list_for_each_entry () and everything else basically always pops out the last HEAD input; Because we can not declare a repeating variable in the loop itself.

Now, what is the answer? Finally, migrate from C89 to the newer C standard; Because this change prevents such a problem from happening. Therefore, it is time to look at the C99 standard. This standard, which is more than 20 years old, is sufficiently new and allows the declaration of block level variables.

Related articles:

Arand Bergman, a Linux kernel developer, acknowledged that upgrading to the new C standard was possible. He announced that it is possible to move towards the 2011 C11 standard. Since C99 has never been very popular and C11 has introduced support for a multidisciplinary standard to increase the security of this language, using this newer standard is a positive step.

It will be easy to use the new C11 standard. Currently, the minimum version of the Linux kernel C-compiler, GCC version 5.1, supports C11.

Torvalds decided to finalize the move after making sure that the new C standard would work smoothly in the Linux kernel. He intends to test this change in the 5.18 integration version. Since the 5.18 integration framework is almost complete, we will probably see C11 code in the Linux kernel in March.

Jonathan Corbett, another Linux kernel developer, has warned that a lot could happen with the release and release of version 5.18. Moving to a newer version of the C language standard can come as a surprise. Corbett believes that if all goes well, the change to C11 will apply to the next version of the kernel.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker