DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Thomas Monjalon <thomas@monjalon.net>, Eli Britstein <elibr@nvidia.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal: fix build with conflicting libc variable memory_order
Date: Thu, 15 Oct 2020 09:12:56 +0200	[thread overview]
Message-ID: <CAJFAV8w8Z2ffLduTN70DVxJ-RWVLhY7my2Azhg+AfkzG7A4PMQ@mail.gmail.com> (raw)
In-Reply-To: <1634944.yJlA45dGKM@thomas>

On Thu, Oct 15, 2020 at 1:16 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> 14/10/2020 08:19, Eli Britstein:
> > The cited commit introduced functions with 'int memory_order' argument.
> > The C11 standard section defines 'memory_order' as the
> > "enumerated type whose enumerators identify memory ordering constraints".
> > Applications that use the standard enum (includes stdatomic.h), will
> > fail compilation with:

Simply including stdatomic.h does not trigger the problem.
Can you rework this commitlog with below info?

> > error: declaration of 'memory_order' shadows a global declaration
> >     [-Werror=shadow]
> >      rte_atomic_thread_fence(int memory_order)
> > Fix it by changing the argument name 'memory_order' to 'memorder'.
> Not clear why it builds fine with most compilers,

I can reproduce in two cases:
- with a gcc that provides a stdatomic.h header + passing
-Wsystem-headers in the CFLAGS,
- with a compiler that does not provide stdatomic.h and you redefine
memory_order in your code (like OVS does),

> but the fix does not hurt.

Otherwise, yes, lgtm.

> > Fixes: 672a15056380 ("eal: add wrapper for C11 atomic thread fence")
> A blank line should be inserted here.
> > Signed-off-by: Eli Britstein <elibr@nvidia.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: David Marchand <david.marchand@redhat.com>

David Marchand

      reply	other threads:[~2020-10-15  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  6:19 Eli Britstein
2020-10-14 13:34 ` Asaf Penso
2020-10-14 23:16 ` Thomas Monjalon
2020-10-15  7:12   ` David Marchand [this message]

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:

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

  git send-email \
    --in-reply-to=CAJFAV8w8Z2ffLduTN70DVxJ-RWVLhY7my2Azhg+AfkzG7A4PMQ@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=elibr@nvidia.com \
    --cc=thomas@monjalon.net \


* 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;
as well as URLs for NNTP newsgroup(s).