[8/9] reorder: use C11 alignof
Checks
Commit Message
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/reorder/rte_reorder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
> -----Original Message-----
> From: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Sent: Thursday, January 25, 2024 12:18 AM
> To: dev@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>; Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>;
> Anoob Joseph <anoobj@marvell.com>; Ferruh Yigit <ferruh.yigit@amd.com>; Honnappa Nagarahalli
> <honnappa.nagarahalli@arm.com>; Jerin Jacob <jerinj@marvell.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Ori Kam
> <orika@nvidia.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Thomas Monjalon
> <thomas@monjalon.net>; Volodymyr Fialko <vfialko@marvell.com>; Tyler Retzlaff
> <roretzla@linux.microsoft.com>
> Subject: [EXT] [PATCH 8/9] reorder: use C11 alignof
>
> External Email
>
> ----------------------------------------------------------------------
> Replace use of __alignof__(T) with C11 alignof(T) to improve portability between toolchains.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
> lib/reorder/rte_reorder.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
__alignof__ is supported by GCC from C99, but since DPDK 23.11 C11 compiler is required anyway, It should be fine to switch.
Acked-by: Volodymyr Fialko <vfialko@marvell.com>
/Volodymyr
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdalign.h>
#include <string.h>
#include <sys/queue.h>
@@ -72,7 +73,7 @@ struct rte_reorder_buffer *
static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
.size = sizeof(rte_reorder_seqn_t),
- .align = __alignof__(rte_reorder_seqn_t),
+ .align = alignof(rte_reorder_seqn_t),
};
if (b == NULL) {