[PATCH v7 01/29] devtools: check packed attributes

Morten Brørup mb at smartsharesystems.com
Sat Dec 28 16:13:28 CET 2024


> From: Andre Muezerie [mailto:andremue at linux.microsoft.com]
> Sent: Monday, 23 December 2024 20.12
> 
> Ensure __rte_packed_begin and __rte_packed_end show up in pairs
> when checking patches.
> 
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
> Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> ---

With GCC, __rte_packed could also be used with enums [1], to reduce their size.

The release notes coming with this patch series should mention that this is no longer possible.

Suggest that this script also checks that __rte_packed_begin is not preceded by "enum" (and whitespace).
(A structure packed with __rte_packed_begin might also be __rte_aligned(), and these two attributes may come in any order, so checking for "struct"+whitespace would introduce an ordering requirement for these two attributes.)

[1] https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-packed-type-attribute



More information about the dev mailing list