blob: fde99b599eb661e7d047426fd9cf344d3c23331e [file] [log] [blame]
Andrew Geissler6ce62a22020-11-30 19:58:47 -06001From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 31 Dec 2019 08:15:34 -0800
4Subject: [PATCH] Detect warning options during configure
Andrew Geissler82c905d2020-04-13 13:39:40 -05005
6Certain options maybe compiler specific therefore its better
7to detect them before use.
8
9nfs_error copies the format string and appends newline to it
10but compiler can forget that it was format string since its not
11same fmt string that was passed. Ignore the warning
12
13Wdiscarded-qualifiers is gcc specific and this is no longer needed
14
15Upstream-Status: Pending
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17
Andrew Geissler6ce62a22020-11-30 19:58:47 -060018---
19 support/nfs/xcommon.c | 3 +++
20 1 file changed, 3 insertions(+)
21
22diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c
23index 3989f0b..e080423 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050024--- a/support/nfs/xcommon.c
25+++ b/support/nfs/xcommon.c
26@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
27
28 fmt2 = xstrconcat2 (fmt, "\n");
29 va_start (args, fmt);
30+#pragma GCC diagnostic push
31+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
32 vfprintf (stderr, fmt2, args);
33+#pragma GCC diagnostic pop
34 va_end (args);
35 free (fmt2);
36 }