diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch deleted file mode 100644 index 69236e8278..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 31 Dec 2019 08:15:34 -0800 -Subject: [PATCH] Detect warning options during configure - -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 - ---- - support/nfs/xcommon.c | 6 ++++++ - support/nfs/xlog.c | 6 ++++++ - support/nfsidmap/libnfsidmap.c | 3 +++ - utils/exportfs/exportfs.c | 3 +++ - 4 files changed, 18 insertions(+) - -diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c -index 3989f0bc..ff438c18 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); - } -@@ -132,7 +135,10 @@ die(int err, const char *fmt, ...) { - va_list args; - - va_start(args, fmt); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vfprintf(stderr, fmt, args); -+#pragma GCC diagnostic pop - fprintf(stderr, "\n"); - va_end(args); - -diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c -index fa125cef..dc4c9ea1 100644 ---- a/support/nfs/xlog.c -+++ b/support/nfs/xlog.c -@@ -178,11 +178,16 @@ xlog_backend(int kind, const char *fmt, va_list args) - fprintf(stderr, "%s: ", log_name); - #endif - va_copy(args2, args); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vfprintf(stderr, fmt, args2); -+#pragma GCC diagnostic pop - fprintf(stderr, "\n"); - va_end(args2); - } - -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - if (log_syslog) { - switch (kind) { - case L_FATAL: -@@ -203,6 +208,7 @@ xlog_backend(int kind, const char *fmt, va_list args) - break; - } - } -+#pragma GCC diagnostic pop - - if (kind == L_FATAL) - exit(1); -diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c -index f8c36480..1a28be0a 100644 ---- a/support/nfsidmap/libnfsidmap.c -+++ b/support/nfsidmap/libnfsidmap.c -@@ -99,7 +99,10 @@ static void default_logger(const char *fmt, ...) - va_list vp; - - va_start(vp, fmt); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vsyslog(LOG_WARNING, fmt, vp); -+#pragma GCC diagnostic pop - va_end(vp); - } - -diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c -index b03a047b..eac1ff2a 100644 ---- a/utils/exportfs/exportfs.c -+++ b/utils/exportfs/exportfs.c -@@ -646,7 +646,10 @@ dumpopt(char c, char *fmt, ...) - - va_start(ap, fmt); - printf("%c", c); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vprintf(fmt, ap); -+#pragma GCC diagnostic pop - va_end(ap); - return ','; - } diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-support-nfs-xcommon.c-fix-a-formatting-error-with-cl.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-support-nfs-xcommon.c-fix-a-formatting-error-with-cl.patch new file mode 100644 index 0000000000..a99ba284e0 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-support-nfs-xcommon.c-fix-a-formatting-error-with-cl.patch @@ -0,0 +1,40 @@ +From cc59a7fe15b6ca2ee43cba0dc1d699323b36ffcc Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 21 Mar 2025 10:42:56 +0100 +Subject: [PATCH] support/nfs/xcommon.c: fix a formatting error with clang + +Specifically, this happens: + +| xcommon.c:101:24: error: format string is not a string literal [-Werror,-Wformat-nonliteral] +| 101 | vfprintf (stderr, fmt2, args); +| | ^~~~ + +A similar approach (print \n seprately) is already used elsewhere in +the same file. + +Upstream-Status: Submitted [via email to steved@redhat.com,linux-nfs@vger.kernel.org] +Signed-off-by: Alexander Kanavin +--- + support/nfs/xcommon.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c +index 3989f0b..1d04dd1 100644 +--- a/support/nfs/xcommon.c ++++ b/support/nfs/xcommon.c +@@ -94,13 +94,11 @@ xstrconcat4 (const char *s, const char *t, const char *u, const char *v) { + void + nfs_error (const char *fmt, ...) { + va_list args; +- char *fmt2; + +- fmt2 = xstrconcat2 (fmt, "\n"); + va_start (args, fmt); +- vfprintf (stderr, fmt2, args); ++ vfprintf (stderr, fmt, args); ++ fprintf (stderr, "\n"); + va_end (args); +- free (fmt2); + } + + /* Make a canonical pathname from PATH. Returns a freshly malloced string. diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb index abbdec7808..1f3afa0560 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb @@ -23,9 +23,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfscommon \ file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ file://0001-Fix-typecast-warning-with-clang.patch \ - file://0001-Detect-warning-options-during-configure.patch \ file://0004-Use-nogroup-for-nobody-group.patch \ file://0005-find-OE-provided-Kerberos.patch \ + file://0003-support-nfs-xcommon.c-fix-a-formatting-error-with-cl.patch \ " SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15"