[PATCH] node: fix C++ compatibility errors (option 2)
Thomas Monjalon
thomas at monjalon.net
Wed Jul 2 12:00:35 CEST 2025
01/07/2025 16:48, Nitin Saxena:
> On Mon, Jun 30, 2025 at 4:27 PM Bruce Richardson
> <bruce.richardson at intel.com> wrote:
> >
> > C++ does not allow zero-sized unions - they end up being of size 1-byte,
> > which leads to C/C++ compatibility issues, flagged by the compiler.
> >
> > lib/node/rte_node_mbuf_dynfield.h:78:2: error: union has size 0 in C,
> > size 1 in C++ [-Werror,-Wextern-c-compat]
> > 78 | union {
> > | ^
> > 1 error generated.
> >
> > Fix the error by omitting the persistent_data field when it is
> > zero-sized, since it's unusable. Any app using the field must already
> > specify a size for the persistent data.
> >
> > Fixes: 746e8736da70 ("node: add global mbuf dynfield")
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
>
> Acked-by: Nitin Saxena <nsaxena at marvell.com>
Applied, thanks.
More information about the dev
mailing list