clang-warnings.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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
  5. Certain options maybe compiler specific therefore its better
  6. to detect them before use.
  7. nfs_error copies the format string and appends newline to it
  8. but compiler can forget that it was format string since its not
  9. same fmt string that was passed. Ignore the warning
  10. Wdiscarded-qualifiers is gcc specific and this is no longer needed
  11. Upstream-Status: Pending
  12. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  13. ---
  14. support/nfs/xcommon.c | 3 +++
  15. 1 file changed, 3 insertions(+)
  16. diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c
  17. index 3989f0b..e080423 100644
  18. --- a/support/nfs/xcommon.c
  19. +++ b/support/nfs/xcommon.c
  20. @@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
  21. fmt2 = xstrconcat2 (fmt, "\n");
  22. va_start (args, fmt);
  23. +#pragma GCC diagnostic push
  24. +#pragma GCC diagnostic ignored "-Wformat-nonliteral"
  25. vfprintf (stderr, fmt2, args);
  26. +#pragma GCC diagnostic pop
  27. va_end (args);
  28. free (fmt2);
  29. }