Skip to contentSkip to conversation

eal/x86: fix pedantic build

PATCH In review Thomas Monjalon 3 participants 5 messages Apr 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal/x86: fix pedantic build

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.

---
 lib/librte_eal/common/include/arch/x86/rte_atomic_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/include/arch/x86/rte_atomic_64.h +1 -1
index 4b8315926..6232c57d9 100644
@@ -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;
 
Signature · 1 line
2.21.0
#1 lore raw

04/04/2019 15:00, Thomas Monjalon:

Quoted 11 lines

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.

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.

Acked-by
#2 lore raw
Quoted 15 lines

04/04/2019 15:00, Thomas Monjalon:

Quoted 1 line

When enabling pedantic compilation with

CONFIG_RTE_LIBRTE_MLX5_DEBUG,

Quoted 10 lines

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.

Quoted 8 lines

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:

Tested-by
#3 lore raw
Quoted 19 lines · Gage
Quoted 19 lines

04/04/2019 15:00, Thomas Monjalon:

Quoted 1 line

When enabling pedantic compilation with

CONFIG_RTE_LIBRTE_MLX5_DEBUG,

Quoted 10 lines

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.

Forgot one line:

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

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:

I confirm it fixes the build issue:

author Applied
#4 lore raw

04/04/2019 17:13, Ferruh Yigit:

Quoted 22 lines · Gage
Quoted 21 lines
Quoted 20 lines

04/04/2019 15:00, Thomas Monjalon:

Quoted 1 line

When enabling pedantic compilation with

CONFIG_RTE_LIBRTE_MLX5_DEBUG,

Quoted 10 lines

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.

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.

Quoted 7 lines
Quoted 3 lines

With that change:

I confirm it fixes the build issue:

Applied, thanks