From patchwork Mon Oct 7 14:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 60622 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5406B1C241; Mon, 7 Oct 2019 16:30:33 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 36BE21C1BC for ; Mon, 7 Oct 2019 16:30:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2019 07:30:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,268,1566889200"; d="scan'208";a="368131120" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2019 07:30:26 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: bluca@debian.org, Bruce Richardson Date: Mon, 7 Oct 2019 15:30:12 +0100 Message-Id: <20191007143013.16252-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191007143013.16252-1-bruce.richardson@intel.com> References: <20190725143831.25116-1-bruce.richardson@intel.com> <20191007143013.16252-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/4] build: enable extra warnings for meson build 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" While meson always adds -Wall flag to C compiles, the make build adds extra warning flags that are not present in the meson build. This addresses that shortcoming by adding additional warning flags to our builds. The one omission is the -Wcast-align flag, which though present in make gcc builds, gives a lot of warnings/errors when used with clang. The removed warning "-Wunused-parameter" is covered by the "-Wextra" parameter so is unnecessary. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- config/meson.build | 24 +++++++++++++++++++++--- drivers/bus/dpaa/meson.build | 3 +++ drivers/event/dsw/meson.build | 3 +++ drivers/net/dpaa/meson.build | 4 ++++ drivers/net/i40e/base/meson.build | 3 ++- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config/meson.build b/config/meson.build index 2bafea530..6918a9ecc 100644 --- a/config/meson.build +++ b/config/meson.build @@ -143,10 +143,28 @@ add_project_arguments('-include', 'rte_config.h', language: 'c') # enable extra warnings and disable any unwanted warnings warning_flags = [ - '-Wunused-parameter', - '-Wsign-compare', + # -Wall is added by meson by default, so add -Wextra only + '-Wextra', + + # additional warnings in alphabetical order '-Wcast-qual', - '-Wno-address-of-packed-member' + '-Wdeprecated', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wmissing-declarations', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wpointer-arith', + '-Wsign-compare', + '-Wstrict-prototypes', + '-Wundef', + '-Wwrite-strings', + + # globally disabled warnings + '-Wno-address-of-packed-member', + '-Wno-packed-not-aligned', + '-Wno-missing-field-initializers' ] if not dpdk_conf.get('RTE_ARCH_64') # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!! diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build index 19daaa5b5..c9c3b2415 100644 --- a/drivers/bus/dpaa/meson.build +++ b/drivers/bus/dpaa/meson.build @@ -27,5 +27,8 @@ allow_experimental_apis = true if cc.has_argument('-Wno-cast-qual') cflags += '-Wno-cast-qual' endif +if cc.has_argument('-Wno-pointer-arith') + cflags += '-Wno-pointer-arith' +endif includes += include_directories('include', 'base/qbman') diff --git a/drivers/event/dsw/meson.build b/drivers/event/dsw/meson.build index a3d09eef3..60ab13d90 100644 --- a/drivers/event/dsw/meson.build +++ b/drivers/event/dsw/meson.build @@ -2,4 +2,7 @@ # Copyright(c) 2018 Ericsson AB deps += ['bus_vdev'] +if cc.has_argument('-Wno-format-nonliteral') + cflags += '-Wno-format-nonliteral' +endif sources = files('dsw_evdev.c', 'dsw_event.c', 'dsw_xstats.c') diff --git a/drivers/net/dpaa/meson.build b/drivers/net/dpaa/meson.build index 94c0e22c5..542b44af4 100644 --- a/drivers/net/dpaa/meson.build +++ b/drivers/net/dpaa/meson.build @@ -10,6 +10,10 @@ deps += ['mempool_dpaa'] sources = files('dpaa_ethdev.c', 'dpaa_rxtx.c') +if cc.has_argument('-Wno-pointer-arith') + cflags += '-Wno-pointer-arith' +endif + allow_experimental_apis = true install_headers('rte_pmd_dpaa.h') diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build index 13d16b08d..3dee8c975 100644 --- a/drivers/net/i40e/base/meson.build +++ b/drivers/net/i40e/base/meson.build @@ -12,7 +12,8 @@ sources = [ ] error_cflags = ['-Wno-sign-compare', '-Wno-unused-value', - '-Wno-format', '-Wno-error=format-security', + '-Wno-format', '-Wno-format-security', + '-Wno-format-nonliteral', '-Wno-strict-aliasing', '-Wno-unused-but-set-variable', '-Wno-unused-parameter', ]