eal/x86: fix pedantic build

Message ID 20190404130009.22042-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series eal/x86: fix pedantic build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon April 4, 2019, 1 p.m. UTC
  When enabling pedantic compilation with CONFIG_RTE_LIBRTE_MLX5_DEBUG,
the compiler complains about non standard 128-bit integer type:

include/rte_atomic_64.h:223:3: error:
ISO C does not support ‘__int128’ types [-Werror=pedantic]

It must be marked as an extension of the standard C language
to be accepted in pedantic compilation.

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/include/arch/x86/rte_atomic_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon April 4, 2019, 1:22 p.m. UTC | #1
04/04/2019 15:00, Thomas Monjalon:
> When enabling pedantic compilation with CONFIG_RTE_LIBRTE_MLX5_DEBUG,
> the compiler complains about non standard 128-bit integer type:
> 
> include/rte_atomic_64.h:223:3: error:
> ISO C does not support ‘__int128’ types [-Werror=pedantic]
> 
> It must be marked as an extension of the standard C language
> to be accepted in pedantic compilation.
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Forgot one line:

Fixes: 640c5f09ef2c ("eal/x86: add 128-bit atomic compare exchange")

Note: It seems only Ferruh can reproduce it.
I wonder whether the RTE_STD_C11 of the union is hiding the issue.
  
Eads, Gage April 4, 2019, 2:14 p.m. UTC | #2
> 04/04/2019 15:00, Thomas Monjalon:
> > When enabling pedantic compilation with
> CONFIG_RTE_LIBRTE_MLX5_DEBUG,
> > the compiler complains about non standard 128-bit integer type:
> >
> > include/rte_atomic_64.h:223:3: error:
> > ISO C does not support ‘__int128’ types [-Werror=pedantic]
> >
> > It must be marked as an extension of the standard C language to be
> > accepted in pedantic compilation.
> >
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Forgot one line:
> 
> Fixes: 640c5f09ef2c ("eal/x86: add 128-bit atomic compare exchange")
> 
> Note: It seems only Ferruh can reproduce it.
> I wonder whether the RTE_STD_C11 of the union is hiding the issue.
> 
> 

With that change:
Acked-by: Gage Eads <gage.eads@intel.com>
  
Ferruh Yigit April 4, 2019, 3:13 p.m. UTC | #3
On 4/4/2019 3:14 PM, Eads, Gage wrote:
> 
>> 04/04/2019 15:00, Thomas Monjalon:
>>> When enabling pedantic compilation with
>> CONFIG_RTE_LIBRTE_MLX5_DEBUG,
>>> the compiler complains about non standard 128-bit integer type:
>>>
>>> include/rte_atomic_64.h:223:3: error:
>>> ISO C does not support ‘__int128’ types [-Werror=pedantic]
>>>
>>> It must be marked as an extension of the standard C language to be
>>> accepted in pedantic compilation.
>>>
>>> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>
>> Forgot one line:
>>
>> Fixes: 640c5f09ef2c ("eal/x86: add 128-bit atomic compare exchange")
>>
>> Note: It seems only Ferruh can reproduce it.
>> I wonder whether the RTE_STD_C11 of the union is hiding the issue.
>>
>>
> 
> With that change:
> Acked-by: Gage Eads <gage.eads@intel.com>
> 

I confirm it fixes the build issue:

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon April 4, 2019, 3:23 p.m. UTC | #4
04/04/2019 17:13, Ferruh Yigit:
> On 4/4/2019 3:14 PM, Eads, Gage wrote:
> >> 04/04/2019 15:00, Thomas Monjalon:
> >>> When enabling pedantic compilation with
> >> CONFIG_RTE_LIBRTE_MLX5_DEBUG,
> >>> the compiler complains about non standard 128-bit integer type:
> >>>
> >>> include/rte_atomic_64.h:223:3: error:
> >>> ISO C does not support ‘__int128’ types [-Werror=pedantic]
> >>>
> >>> It must be marked as an extension of the standard C language to be
> >>> accepted in pedantic compilation.
> >>>
> >>> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >>
> >> Forgot one line:
> >>
> >> Fixes: 640c5f09ef2c ("eal/x86: add 128-bit atomic compare exchange")
> >>
> >> Note: It seems only Ferruh can reproduce it.
> >> I wonder whether the RTE_STD_C11 of the union is hiding the issue.
> > 
> > With that change:
> > Acked-by: Gage Eads <gage.eads@intel.com>
> > 
> 
> I confirm it fixes the build issue:
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h b/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
index 4b8315926..6232c57d9 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
@@ -220,7 +220,7 @@  typedef struct {
 	RTE_STD_C11
 	union {
 		uint64_t val[2];
-		__int128 int128;
+		__extension__ __int128 int128;
 	};
 } __rte_aligned(16) rte_int128_t;