[dpdk-dev] net/mlx5: fix compilation issue in debug mode

Message ID f9f45a384e9f9d9cd9c642b9e87417d1e4f0bcfc.1499070324.git.adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Adrien Mazarguil July 3, 2017, 8:27 a.m. UTC
  Even in C11, using types other than _Bool or signed/unsigned int for
bit-fields is an extension. Some GCC versions complain about that when
-pedantic checks are enabled.

The RTE_STD_C11 macro correctly prevented this issue with C99 but not with
C11 as it becomes a no-op. Forcing the extension keyword addresses it.

Fixes: 143c03925695 ("net/mlx: update C compliance standard")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Tested-by: Yongseok Koh <yskoh@mellanox.com>
---
Ferruh, squashing this commit with the previous one and discarding its
log is fine if you want. Thanks.
---
 drivers/net/mlx5/mlx5_rxtx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit July 3, 2017, 9:18 a.m. UTC | #1
On 7/3/2017 9:27 AM, Adrien Mazarguil wrote:
> Even in C11, using types other than _Bool or signed/unsigned int for
> bit-fields is an extension. Some GCC versions complain about that when
> -pedantic checks are enabled.
> 
> The RTE_STD_C11 macro correctly prevented this issue with C99 but not with
> C11 as it becomes a no-op. Forcing the extension keyword addresses it.
> 
> Fixes: 143c03925695 ("net/mlx: update C compliance standard")
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Tested-by: Yongseok Koh <yskoh@mellanox.com>
> ---
> Ferruh, squashing this commit with the previous one and discarding its
> log is fine if you want. Thanks.

Squashed into relevant commit in next-net, thanks.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 450a569..4195665 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -240,7 +240,7 @@  struct hash_rxq {
 };
 
 /* TX queue descriptor. */
-RTE_STD_C11
+__extension__
 struct txq {
 	uint16_t elts_head; /* Current index in (*elts)[]. */
 	uint16_t elts_tail; /* First element awaiting completion. */