DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma
@ 2019-10-01 11:10 Viacheslav Ovsiienko
  2019-10-01 14:54 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Viacheslav Ovsiienko @ 2019-10-01 11:10 UTC (permalink / raw)
  To: dev; +Cc: matan, rasland, ferruh.yigit

Some compilers (i.e Intel icc) do not recognize GCC diagnostic
pragma, the compiler check is added.

Fixes: a46a42b5cd03 ("net/mlx5: add VF LAG mode bonding device recognition")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 951b9f5..7a3f654 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2296,11 +2296,15 @@ struct mlx5_dev_spawn_data {
 	if (!file)
 		return -1;
 	MKSTR(format, "%c%us", '%', (unsigned int)(sizeof(ifname) - 1));
-
-	/* Use safe format to check maximal buffer length. */
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 40600)
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
+	/* Use safe format to check maximal buffer length. */
 	while (fscanf(file, format, ifname) == 1) {
-#pragma GCC diagnostic error "-Wformat-nonliteral"
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 40600)
+#pragma GCC diagnostic pop
+#endif
 		char tmp_str[IF_NAMESIZE + 32];
 		struct rte_pci_addr pci_addr;
 		struct mlx5_switch_info	info;
-- 
1.8.3.1


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

end of thread, other threads:[~2019-10-02 16:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 11:10 [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma Viacheslav Ovsiienko
2019-10-01 14:54 ` Stephen Hemminger
2019-10-01 17:15   ` Slava Ovsiienko
2019-10-01 23:41     ` Stephen Hemminger
2019-10-02  6:15       ` Slava Ovsiienko
2019-10-02  6:55         ` Slava Ovsiienko
2019-10-02 11:54           ` Ferruh Yigit
2019-10-02 12:40             ` Slava Ovsiienko
2019-10-02  6:08 ` [dpdk-dev] [PATCH v2] " Viacheslav Ovsiienko
2019-10-02 12:36 ` [dpdk-dev] [PATCH v3] " Viacheslav Ovsiienko
2019-10-02 16:19   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).