From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A776A2EDB for ; Tue, 1 Oct 2019 13:10:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85EDC397D; Tue, 1 Oct 2019 13:10:34 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1F2C32BF7 for ; Tue, 1 Oct 2019 13:10:33 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 Oct 2019 14:10:27 +0300 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x91BARHU020335; Tue, 1 Oct 2019 14:10:27 +0300 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id x91BARPW006651; Tue, 1 Oct 2019 11:10:27 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x91BAQLf006650; Tue, 1 Oct 2019 11:10:26 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com, ferruh.yigit@intel.com Date: Tue, 1 Oct 2019 11:10:23 +0000 Message-Id: <1569928223-6600-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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