From: Andre Muezerie <andremue@linux.microsoft.com>
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 [thread overview]
Message-ID: <1736887611-32186-3-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1736887611-32186-1-git-send-email-andremue@linux.microsoft.com>
Added MSVC specific compiler flag to ignore warnings about unused
variables, like is being done for other compilers.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
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
prev parent reply other threads:[~2025-01-14 20:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 18:41 [PATCH 0/2] remove unused variables and add MSVC compiler flag Andre Muezerie
2024-12-26 18:41 ` [PATCH 1/2] drivers/common: " Andre Muezerie
2025-01-06 10:50 ` Bruce Richardson
2024-12-26 18:41 ` [PATCH 2/2] drivers/net: " Andre Muezerie
2025-01-14 17:46 ` Stephen Hemminger
2025-01-14 20:46 ` [PATCH v2 0/2] " Andre Muezerie
2025-01-14 20:46 ` [PATCH v2 1/2] drivers/common: " Andre Muezerie
2025-01-14 20:46 ` Andre Muezerie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1736887611-32186-3-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=dsinghrawat@marvell.com \
--cc=palok@marvell.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).