[PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
Stephen Hemminger
stephen at networkplumber.org
Wed Sep 30 17:26:38 CEST 2026
On Wed, 30 Sep 2026 11:57:59 +0200
Maxime Coquelin <maxime.coquelin at redhat.com> wrote:
> This patch adds a compatibility define for __counted_by attribute,
> which is not present in older compilers but required for recent UAPI
> headers like vfio.h.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
> config/rte_config.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 0447cdf2ad..307e7dac62 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -25,6 +25,15 @@
> #define RTE_TOOLCHAIN_MSVC 1
> #endif
>
> +/*
> + * Compatibility define for Linux kernel UAPI headers that may use __counted_by
> + * attribute for bounds checking. This attribute is not understood by userspace
> + * compilers, so define it as empty if not already provided.
> + */
> +#ifndef __counted_by
> +#define __counted_by(m)
> +#endif
> +
> /* legacy defines */
> #ifdef RTE_EXEC_ENV_LINUX
> #define RTE_EXEC_ENV_LINUXAPP 1
NAK this is best done by keeping up to date stddef over in virtio headers.
More information about the dev
mailing list