From patchwork Wed Nov 18 18:11:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 84339 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98684A04DD; Wed, 18 Nov 2020 19:11:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E298EC8DE; Wed, 18 Nov 2020 19:11:16 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 39A2BC872 for ; Wed, 18 Nov 2020 19:11:13 +0100 (CET) IronPort-SDR: 8RaR7Im5tl0slh/8be4QPIJ552pLHom73G7rtSj2BnXYpC9bIDoEBnBvGboO9+B7ZJNFmquPBz exYkPPdXArAg== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="189240733" X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="189240733" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 10:11:12 -0800 IronPort-SDR: me6Co0sudOu4z9/RKa1uyF8nCMbDkieW+y+uad9S4tanG4H1PtAkm4fl2ksXXSsbGc2lyvGp6E XHAB7qSKnm9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="476464016" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by orsmga004.jf.intel.com with ESMTP; 18 Nov 2020 10:11:09 -0800 From: Conor Walsh To: bruce.richardson@intel.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, bluca@debian.org, stuart.schacher@broadcom.com, venkatkumar.duvvuru@broadcom.com, michael.wildt@broadcom.com Cc: dev@dpdk.org, linglix.chen@intel.com, thomas@monjalon.net, Conor Walsh , Chen@dpdk.org Date: Wed, 18 Nov 2020 18:11:02 +0000 Message-Id: <20201118181103.3865787-2-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118181103.3865787-1-conor.walsh@intel.com> References: <20201112113537.1996073-1-conor.walsh@intel.com> <20201118181103.3865787-1-conor.walsh@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/2] build: fix gcc compile warnings by adding wformat 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" On some CentOS/RHEL systems using gcc 8.3.1 to compile dpdk, gcc shows a warning on every build step saying that -Wformat-nonliteral and -Wformat-security warnings will be ignored unless -Wformat is also specified as a compiler flag. When the build is run with -werror the build will fail due to these warnings. Exact warning returned: cc1: error: -Wformat-nonliteral ignored without -Wformat [-Werror=format-nonliteral] cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security] cc1: all warnings being treated as errors This patch adds the -Wformat flag to config/meson.build. The warning id 181 has also been suppressed in icc as icc was showing false positives with -Wformat enabled. Fixes: 524a0d5d66b9 ("build: enable extra warnings with meson") Cc: bruce.richardson@intel.com Signed-off-by: Conor Walsh Tested-by: Chen, LingliX --- config/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/meson.build b/config/meson.build index a29693b883..c02802c18e 100644 --- a/config/meson.build +++ b/config/meson.build @@ -194,6 +194,7 @@ warning_flags = [ # additional warnings in alphabetical order '-Wcast-qual', '-Wdeprecated', + '-Wformat', '-Wformat-nonliteral', '-Wformat-security', '-Wmissing-declarations', @@ -220,7 +221,7 @@ if not dpdk_conf.get('RTE_ARCH_64') warning_flags += '-Wno-pointer-to-int-cast' endif if cc.get_id() == 'intel' - warning_ids = [188, 2203, 2279, 2557, 3179, 3656] + warning_ids = [181, 188, 2203, 2279, 2557, 3179, 3656] foreach i:warning_ids warning_flags += '-diag-disable=@0@'.format(i) endforeach From patchwork Wed Nov 18 18:11:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 84340 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6214DA04DD; Wed, 18 Nov 2020 19:11:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA3EBC90E; Wed, 18 Nov 2020 19:11:18 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 22124C8DC for ; Wed, 18 Nov 2020 19:11:15 +0100 (CET) IronPort-SDR: Zm3+NJm1NE/dA2OmpDqeIZfKux989QMl7gB4V6xXXeviVN38Np2A8eaY0sexvzT/+C5w/UdNEt ncXiNHawEj7g== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="189240737" X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="189240737" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 10:11:15 -0800 IronPort-SDR: KbKOwVwtm/hPuWObknRIj/p0gCMQuQDE78/J/yaGKNw00aG99OEcDn5vxMjIV7wNxiw6U4ytLR yQ+4OphRHQkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="476464071" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by orsmga004.jf.intel.com with ESMTP; 18 Nov 2020 10:11:12 -0800 From: Conor Walsh To: bruce.richardson@intel.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, bluca@debian.org, stuart.schacher@broadcom.com, venkatkumar.duvvuru@broadcom.com, michael.wildt@broadcom.com Cc: dev@dpdk.org, linglix.chen@intel.com, thomas@monjalon.net, Conor Walsh Date: Wed, 18 Nov 2020 18:11:03 +0000 Message-Id: <20201118181103.3865787-3-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118181103.3865787-1-conor.walsh@intel.com> References: <20201112113537.1996073-1-conor.walsh@intel.com> <20201118181103.3865787-1-conor.walsh@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/2] net/bnxt: fix format characters for unsigned values 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" &device requires the %u format specifer not the %d specifier, as &device is unsigned. Fixes: a46bbb57605b ("net/bnxt: update multi device design") Cc: michael.wildt@broadcom.com Signed-off-by: Conor Walsh --- drivers/net/bnxt/tf_core/tf_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c index 0f49a00256..24d49096a7 100644 --- a/drivers/net/bnxt/tf_core/tf_core.c +++ b/drivers/net/bnxt/tf_core/tf_core.c @@ -44,7 +44,7 @@ tf_open_session(struct tf *tfp, /* Verify control channel and build the beginning of session_id */ rc = sscanf(parms->ctrl_chan_name, - "%x:%x:%x.%d", + "%x:%x:%x.%u", &domain, &bus, &slot, @@ -57,7 +57,7 @@ tf_open_session(struct tf *tfp, /* Check parsing of bus/slot/device */ rc = sscanf(parms->ctrl_chan_name, - "%x:%x.%d", + "%x:%x.%u", &bus, &slot, &device); @@ -102,7 +102,7 @@ tf_attach_session(struct tf *tfp, /* Verify control channel */ rc = sscanf(parms->ctrl_chan_name, - "%x:%x:%x.%d", + "%x:%x:%x.%u", &domain, &bus, &slot, @@ -115,7 +115,7 @@ tf_attach_session(struct tf *tfp, /* Verify 'attach' channel */ rc = sscanf(parms->attach_chan_name, - "%x:%x:%x.%d", + "%x:%x:%x.%u", &domain, &bus, &slot,