All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx: update C compliance standard
@ 2017-06-30 17:19 Adrien Mazarguil
  2017-06-30 17:47 ` Ferruh Yigit
  2017-07-03  8:27 ` [PATCH] net/mlx5: fix compilation issue in debug mode Adrien Mazarguil
  0 siblings, 2 replies; 8+ messages in thread
From: Adrien Mazarguil @ 2017-06-30 17:19 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Nelio Laranjeiro, dev

This commit addresses a compilation issue against Glibc >= 2.25, which
implements assert() through a nonstandard ({ }) construct. Such constructs
can normally not be used without __extension__ keyword when -pedantic is
enabled, as is the case when compiling mlx4 and mlx5 PMDs in debug mode.

While assert.h checks for the compiler ability to support GNU extensions,
Clang, unlike GCC, does not allow the above syntax when combining
-std=gnu99 with -pedantic.

Work around missing keyword by moving these PMDs to a stricter compliance
standard without GNU extensions but properly checked by Glibc. Doing so is
supported on the DPDK side since includes have been cleaned up.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/Makefile | 2 +-
 drivers/net/mlx5/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index e873fb4..755c8a4 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -40,7 +40,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_flow.c
 
 # Basic CFLAGS.
 CFLAGS += -O3
-CFLAGS += -std=gnu99 -Wall -Wextra
+CFLAGS += -std=c11 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
 CFLAGS += -D_BSD_SOURCE
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index daf8013..8b8f6ea 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -52,7 +52,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow.c
 
 # Basic CFLAGS.
 CFLAGS += -O3
-CFLAGS += -std=gnu99 -Wall -Wextra
+CFLAGS += -std=c11 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
 CFLAGS += -D_BSD_SOURCE
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-03  9:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 17:19 [PATCH] net/mlx: update C compliance standard Adrien Mazarguil
2017-06-30 17:47 ` Ferruh Yigit
2017-06-30 18:14   ` Yongseok Koh
2017-06-30 18:25     ` Yongseok Koh
2017-07-01 15:58       ` Ferruh Yigit
2017-07-02  0:12         ` Yongseok Koh
2017-07-03  8:27 ` [PATCH] net/mlx5: fix compilation issue in debug mode Adrien Mazarguil
2017-07-03  9:18   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.