[PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
Maxime Coquelin
maxime.coquelin at redhat.com
Wed Sep 30 11:57:59 CEST 2026
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
--
2.55.0
More information about the dev
mailing list