<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Sep 30, 2026 at 5:26 PM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 30 Sep 2026 11:57:59 +0200<br>
Maxime Coquelin <<a href="mailto:maxime.coquelin@redhat.com" target="_blank">maxime.coquelin@redhat.com</a>> wrote:<br>
<br>
> This patch adds a compatibility define for __counted_by attribute,<br>
> which is not present in older compilers but required for recent UAPI<br>
> headers like vfio.h.<br>
> <br>
> Signed-off-by: Maxime Coquelin <<a href="mailto:maxime.coquelin@redhat.com" target="_blank">maxime.coquelin@redhat.com</a>><br>
> ---<br>
> config/rte_config.h | 9 +++++++++<br>
> 1 file changed, 9 insertions(+)<br>
> <br>
> diff --git a/config/rte_config.h b/config/rte_config.h<br>
> index 0447cdf2ad..307e7dac62 100644<br>
> --- a/config/rte_config.h<br>
> +++ b/config/rte_config.h<br>
> @@ -25,6 +25,15 @@<br>
> #define RTE_TOOLCHAIN_MSVC 1<br>
> #endif<br>
> <br>
> +/*<br>
> + * Compatibility define for Linux kernel UAPI headers that may use __counted_by<br>
> + * attribute for bounds checking. This attribute is not understood by userspace<br>
> + * compilers, so define it as empty if not already provided.<br>
> + */<br>
> +#ifndef __counted_by<br>
> +#define __counted_by(m)<br>
> +#endif<br>
> +<br>
> /* legacy defines */<br>
> #ifdef RTE_EXEC_ENV_LINUX<br>
> #define RTE_EXEC_ENV_LINUXAPP 1<br>
<br>
NAK this is best done by keeping up to date stddef over in virtio headers.<br>
<br></blockquote><div><br></div><div>This is for VFIO, not Virtio but that does not change the issue.</div><div><br></div><div>Problem is importing stddef in UAPI as currently done, does not work,</div><div>because the system version is included first so the imported one is discarded. </div><div><br></div><div>An alternative solution I tested would be to include the imported headers first,</div><div>but it means imported headers get silently intermixed, which worked in my test</div><div>but could lead to hard to debug issues.</div><div><br></div><div>While not ideal, the solution proposed in this patch is harmless, we are talking</div><div>about an attribute defined as empty.</div><div><br></div><div>Thomas, David, what do you think?</div><div><br></div><div>Thanks,</div><div>Maxime</div><div><br></div></div></div>