[PATCH v20] eal: add may_alias to unaligned typedefs

Scott Mitchell scott.k.mitch1 at gmail.com
Wed Dec 2 18:28:55 CET 2026


Thanks Morten. v21 says "may be used to", and moves the
__rte_may_alias definition up and uses it in the typedefs.

On placement: v19 put the attribute in the typedef lines
(https://patches.dpdk.org/project/dpdk/patch/20260202044841.90945-2-scott.k.mitch1@gmail.com/),
and David pointed out that checkpatch's check_aligned_attributes flags
any added line using __rte_aligned outside a struct/union
(https://mails.dpdk.org/archives/test-report/2026-February/955237.html).
Placing it next to __rte_aligned(1), or between the type and the name,
changes those lines the same way. So v21 keeps it as a leading
attribute on its own line, leaving the __rte_aligned(1) lines
unchanged:

__rte_may_alias
typedef uint64_t unaligned_uint64_t __rte_aligned(1);
I checked that the leading form takes effect with a TBAA probe (store
a float, store through the typedef, read the float back). Without
may_alias the reload is folded to a constant; with it, the reload
stays, with gcc 11 and clang 21 and 23. Alignment stays 1.


More information about the stable mailing list