From: Khem Raj <raj.khem@gmail.com>
To: linux-nfs@vger.kernel.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 1/2] Detect warning options during configure
Date: Mon, 15 Aug 2022 14:55:10 -0700 [thread overview]
Message-ID: <20220815215511.2595236-1-raj.khem@gmail.com> (raw)
Certain options maybe compiler specific therefore its better
to detect them before use.
nfs_error copies the format string and appends newline to it
but compiler can forget that it was format string since its not
same fmt string that was passed. Ignore the warning
Wdiscarded-qualifiers is gcc specific and this is no longer needed
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
%% original patch: clang-warnings.patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
support/nfs/xcommon.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c
index 3989f0bc..e080423f 100644
--- a/support/nfs/xcommon.c
+++ b/support/nfs/xcommon.c
@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
fmt2 = xstrconcat2 (fmt, "\n");
va_start (args, fmt);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
vfprintf (stderr, fmt2, args);
+#pragma GCC diagnostic pop
va_end (args);
free (fmt2);
}
--
2.37.2
next reply other threads:[~2022-08-16 2:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 21:55 Khem Raj [this message]
2022-08-15 21:55 ` [PATCH 2/2] mountd: Check for return of stat function Khem Raj
2022-08-16 2:41 ` [PATCH 1/2] Detect warning options during configure Khem Raj
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=20220815215511.2595236-1-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=linux-nfs@vger.kernel.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