]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3 lib system: Fix clang compilation error
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 8 Feb 2021 20:06:12 +0000 (09:06 +1300)
committerJeremy Allison <jra@samba.org>
Tue, 9 Feb 2021 03:09:34 +0000 (03:09 +0000)
Fix clang compilation error:
   error: format string is not a string literal [-Werror,-Wformat-nonliteral]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/system.c

index 8ea2af9f93bbe305b66eb238a7849e4d3e434c02..09bdf1fa7283b8afa23ec7208100f948a282ac4d 100644 (file)
@@ -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;
        }