diff mbox series

[1/2] Detect warning options during configure

Message ID 20220815215511.2595236-1-raj.khem@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] Detect warning options during configure | expand

Commit Message

Khem Raj Aug. 15, 2022, 9:55 p.m. UTC
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(+)

Comments

Khem Raj Aug. 16, 2022, 2:41 a.m. UTC | #1
Please ignore this patch. It was not right one. I am sending a v2
diff mbox series

Patch

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);
 }