On Thu, Oct 15, 2020 at 1:16 AM Thomas Monjalon <tho...@monjalon.net> wrote:
>
> 14/10/2020 08:19, Eli Britstein:
> > The cited commit introduced functions with 'int memory_order' argument.
> > The C11 standard section 7.17.1.4 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 <el...@nvidia.com>
>
> Acked-by: Thomas Monjalon <tho...@monjalon.net>

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


-- 
David Marchand

Reply via email to