From: Gary Lockyer Date: Mon, 8 Feb 2021 20:06:12 +0000 (+1300) Subject: s3 lib system: Fix clang compilation error X-Git-Tag: tevent-0.11.0~1782 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29fa97390d0ef4ff993dfbb2643467c12dd31e76;p=thirdparty%2Fsamba.git 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 --- 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; }