From 29fa97390d0ef4ff993dfbb2643467c12dd31e76 Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Tue, 9 Feb 2021 09:06:12 +1300 Subject: [PATCH] s3 lib system: Fix clang compilation error Fix clang compilation error: error: format string is not a string literal [-Werror,-Wformat-nonliteral] Signed-off-by: Gary Lockyer Reviewed-by: Jeremy Allison --- source3/lib/system.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/lib/system.c b/source3/lib/system.c index 8ea2af9f93b..09bdf1fa728 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1076,10 +1076,17 @@ const char *sys_proc_fd_path(int fd, char *buf, int bufsize) return NULL; } +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif written = snprintf(buf, bufsize, proc_fd_pattern, fd); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif if (written >= bufsize) { return NULL; } -- 2.47.3