Linus Rejects "Size Of Member" Change From Linux 5.5 Kernel
This weekend was the last-minute pull request by Google's Kees Cook to introduce the new sizeof_member() macro that had been previously rejected from Linux 5.4. Well, it was again rejected by Linus Torvalds prior to tagging the Linux 5.5-rc1 kernel.
The sizeof_member() macro has been aimed to unify 2~3 other macros within the kernel tree currently and using the size-of-field moniker, but Cook argued that for measuring the size of a member of a C struct, the new macro is more appropriate and converted usage of the old macros to this new single macro.
Torvalds erred on the side of caution and avoiding juvenile jokes, decided to not honor that pull request for Linux 5.5. He wrote:
Hopefully for Linux 5.6 we'll see the unification done for sizeof_field(). At least Linux 5.5 has a ton of practical changes.
The sizeof_member() macro has been aimed to unify 2~3 other macros within the kernel tree currently and using the size-of-field moniker, but Cook argued that for measuring the size of a member of a C struct, the new macro is more appropriate and converted usage of the old macros to this new single macro.
Torvalds erred on the side of caution and avoiding juvenile jokes, decided to not honor that pull request for Linux 5.5. He wrote:
So this one I'm _still_ not convinced about. It makes yet another name for something we've had before, which just annoys me. And maybe it's the 13-year old in me, but "sizeof_member()" just makes me go "that's puerile".
I _can_ see why we'd want to standardize on one of the tree versions we have, but I can't really see the problem with the existing #define that we have, and that is used (admittedly not all that much): sizeof_field().
Linus
Hopefully for Linux 5.6 we'll see the unification done for sizeof_field(). At least Linux 5.5 has a ton of practical changes.
33 Comments