From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14EC74606E; Tue, 14 Jan 2025 21:47:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEEF8402B5; Tue, 14 Jan 2025 21:47:01 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A5F9D40298 for ; Tue, 14 Jan 2025 21:46:58 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id C72D52043F29; Tue, 14 Jan 2025 12:46:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C72D52043F29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1736887617; bh=5WlmKH9F7TQdFUMs0dXyq1Wd1JqxEpxSir8UW+obn9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVR3C2gQu6xHgawMkPB7WokGoBZLPbQ5O84/hCKpKnyIcI/AXdMcmeX1BDwLwyA3E pM22tBG6yEJLsfij3pNNN7wlTcv5MXEUQvhVTIBXwj7dWOzzv6Jc2m6ObD7oc9D+Qk QG+ERgYD+EbQ7TZBsuKMM0sS+40Uup1YldpVvc8s= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: anatoly.burakov@intel.com, bruce.richardson@intel.com, dev@dpdk.org, dsinghrawat@marvell.com, palok@marvell.com, stephen@networkplumber.org Subject: [PATCH v2 2/2] drivers/net: add MSVC compiler flag for unused variables Date: Tue, 14 Jan 2025 12:46:51 -0800 Message-Id: <1736887611-32186-3-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1736887611-32186-1-git-send-email-andremue@linux.microsoft.com> References: <1735238504-15597-3-git-send-email-andremue@linux.microsoft.com> <1736887611-32186-1-git-send-email-andremue@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added MSVC specific compiler flag to ignore warnings about unused variables, like is being done for other compilers. Signed-off-by: Andre Muezerie --- drivers/net/ice/base/meson.build | 16 ++++++--- drivers/net/qede/base/meson.build | 57 +++++++++++++++++-------------- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/drivers/net/ice/base/meson.build b/drivers/net/ice/base/meson.build index addb922ac9..a291d05b93 100644 --- a/drivers/net/ice/base/meson.build +++ b/drivers/net/ice/base/meson.build @@ -31,11 +31,17 @@ sources = [ 'ice_vf_mbx.c', ] -error_cflags = [ - '-Wno-unused-but-set-variable', - '-Wno-unused-variable', - '-Wno-unused-parameter', -] +if is_ms_compiler + error_cflags = [ + '/wd4101', # unreferenced local variable + ] +else + error_cflags = [ + '-Wno-unused-but-set-variable', + '-Wno-unused-variable', + '-Wno-unused-parameter', + ] +endif # Bugzilla ID: 678 if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0')) diff --git a/drivers/net/qede/base/meson.build b/drivers/net/qede/base/meson.build index 4ad177b478..66251360bf 100644 --- a/drivers/net/qede/base/meson.build +++ b/drivers/net/qede/base/meson.build @@ -19,31 +19,38 @@ sources = [ ] -error_cflags = [ - '-Wno-unused-parameter', - '-Wno-sign-compare', - '-Wno-missing-prototypes', - '-Wno-cast-qual', - '-Wno-unused-function', - '-Wno-unused-variable', - '-Wno-strict-aliasing', - '-Wno-missing-prototypes', - '-Wno-unused-value', - '-Wno-format-nonliteral', - '-Wno-shift-negative-value', - '-Wno-unused-but-set-variable', - '-Wno-missing-declarations', - '-Wno-maybe-uninitialized', - '-Wno-strict-prototypes', - '-Wno-shift-negative-value', - '-Wno-implicit-fallthrough', - '-Wno-format-extra-args', - '-Wno-visibility', - '-Wno-empty-body', - '-Wno-invalid-source-encoding', - '-Wno-sometimes-uninitialized', - '-Wno-pointer-bool-conversion', -] +if is_ms_compiler + error_cflags = [ + '/wd4101', # unreferenced local variable + ] +else + error_cflags = [ + '-Wno-unused-parameter', + '-Wno-sign-compare', + '-Wno-missing-prototypes', + '-Wno-cast-qual', + '-Wno-unused-function', + '-Wno-unused-variable', + '-Wno-strict-aliasing', + '-Wno-missing-prototypes', + '-Wno-unused-value', + '-Wno-format-nonliteral', + '-Wno-shift-negative-value', + '-Wno-unused-but-set-variable', + '-Wno-missing-declarations', + '-Wno-maybe-uninitialized', + '-Wno-strict-prototypes', + '-Wno-shift-negative-value', + '-Wno-implicit-fallthrough', + '-Wno-format-extra-args', + '-Wno-visibility', + '-Wno-empty-body', + '-Wno-invalid-source-encoding', + '-Wno-sometimes-uninitialized', + '-Wno-pointer-bool-conversion', + ] +endif + c_args = cflags foreach flag: error_cflags if cc.has_argument(flag) -- 2.47.0.vfs.0.3