Linux Lands And Then Reverts Usage Of Flexible Array Members
As a change past the Linux 5.8 merge window now that the flurry of code activity has settled down was changing the use of zero-length arrays in structs with flexible array members. Linus Torvalds did pull the change into Linux 5.8 but then decided shortly afterwards to drop the change at least for the time being.
The pull request replaced all the existing zero-length array usage within the kernel with C99 flexible array members for dynamically-sized trailing elements in a C structure. Using flexible array members is intended to provide proper sizeof() calculations, the ability for the code compiler to generate errors when improperly used, and avoid potential undefined behavior scenarios.
The flexible array member syntax has been standardized since C99 and the patches shifting away from zero-length arrays have been baking in linux-next for a while. The pull request lays out all of the details.
Linus Torvalds on Monday pulled in the changes only to have regrets and backed them out of the current mainline tree. Torvalds explained he was unhappy about the repetitive boiler-plate messages in all of the patches that amounted to around 2,000 lines of the same messages, thereby mucking up the Git log display, etc. So for now at least until the patches are reworked, the code is no longer in Linux 5.8.
The pull request replaced all the existing zero-length array usage within the kernel with C99 flexible array members for dynamically-sized trailing elements in a C structure. Using flexible array members is intended to provide proper sizeof() calculations, the ability for the code compiler to generate errors when improperly used, and avoid potential undefined behavior scenarios.
The flexible array member syntax has been standardized since C99 and the patches shifting away from zero-length arrays have been baking in linux-next for a while. The pull request lays out all of the details.
Linus Torvalds on Monday pulled in the changes only to have regrets and backed them out of the current mainline tree. Torvalds explained he was unhappy about the repetitive boiler-plate messages in all of the patches that amounted to around 2,000 lines of the same messages, thereby mucking up the Git log display, etc. So for now at least until the patches are reworked, the code is no longer in Linux 5.8.
4 Comments