public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: <stable@dpdk.org>
Cc: <dev@dpdk.org>
Subject: RE: [PATCH] eal: fix cache guard for pedantic compilation
Date: Mon, 23 Mar 2026 09:14:41 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F657B0@smartserver.smartshare.dk> (raw)
In-Reply-To: <20260323081204.748909-1-mb@smartsharesystems.com>

Forgot cc stable.

> From: Morten Brørup [mailto:mb@smartsharesystems.com]
> Sent: Monday, 23 March 2026 09.12
> 
> The cache guard macro uses __COUNTER__ to generate unique names.
> However, although most C compilers support __COUNTER__, it is not yet
> part of the C standard, so compilation fails when building in pedantic
> mode.
> The macro was changed to use __LINE__ instead.
> 
> Fixes: 65f600c0f000 ("eal: add empty cache line macro")
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/eal/include/rte_common.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/eal/include/rte_common.h
> b/lib/eal/include/rte_common.h
> index 573bf4f2ce..97865aaa39 100644
> --- a/lib/eal/include/rte_common.h
> +++ b/lib/eal/include/rte_common.h
> @@ -751,8 +751,12 @@ rte_is_aligned(const void * const __rte_restrict
> ptr, const unsigned int align)
>   *
>   * Use as spacing between data accessed by different lcores,
>   * to prevent cache thrashing on hardware with speculative
> prefetching.
> + *
> + * Note: Although __COUNTER__ would be better for uniqueness, it is
> not yet
> + * (March 2026) part of the C standard, so compilation would fail when
> building
> + * in pedantic mode.
>   */
> -#define RTE_CACHE_GUARD _RTE_CACHE_GUARD_HELPER1(__COUNTER__)
> +#define RTE_CACHE_GUARD _RTE_CACHE_GUARD_HELPER1(__LINE__)
> 
>  /*********** PA/IOVA type definitions ********/
> 
> --
> 2.43.0


  reply	other threads:[~2026-03-23  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  8:12 [PATCH] eal: fix cache guard for pedantic compilation Morten Brørup
2026-03-23  8:14 ` Morten Brørup [this message]
2026-03-25 14:40 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35F657B0@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox