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 v3 2/2] drivers/net: add MSVC compiler flag for unused variables
Date: Wed, 5 Feb 2025 10:53:10 -0800 [thread overview]
Message-ID: <1738781590-2408-3-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1738781590-2408-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/qede/base/meson.build | 57 +++++++++++++++++--------------
1 file changed, 32 insertions(+), 25 deletions(-)
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.2.vfs.0.1
prev parent reply other threads:[~2025-02-05 18:53 UTC|newest]
Thread overview: 13+ 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 ` [PATCH v2 2/2] drivers/net: add MSVC compiler flag for unused variables Andre Muezerie
2025-02-05 18:33 ` Stephen Hemminger
2025-02-05 18:54 ` Andre Muezerie
2025-02-05 18:53 ` [PATCH v3 0/2] remove unused variables and add MSVC compiler flag Andre Muezerie
2025-02-05 18:53 ` [PATCH v3 1/2] drivers/common: " Andre Muezerie
2025-02-05 18:53 ` 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=1738781590-2408-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.