Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame^] | 1 | From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 31 Dec 2019 08:15:34 -0800 |
| 4 | Subject: [PATCH] Detect warning options during configure |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | |
| 6 | Certain options maybe compiler specific therefore its better |
| 7 | to detect them before use. |
| 8 | |
| 9 | nfs_error copies the format string and appends newline to it |
| 10 | but compiler can forget that it was format string since its not |
| 11 | same fmt string that was passed. Ignore the warning |
| 12 | |
| 13 | Wdiscarded-qualifiers is gcc specific and this is no longer needed |
| 14 | |
| 15 | Upstream-Status: Pending |
| 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 17 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame^] | 18 | --- |
| 19 | support/nfs/xcommon.c | 3 +++ |
| 20 | 1 file changed, 3 insertions(+) |
| 21 | |
| 22 | diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c |
| 23 | index 3989f0b..e080423 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | --- 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 | } |