Skip to content

Commit

Permalink
s3 lib system: Fix clang compilation error
Browse files Browse the repository at this point in the history
Fix clang compilation error:
   error: format string is not a string literal [-Werror,-Wformat-nonliteral]

Signed-off-by: Gary Lockyer <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
GaryWL authored and jrasamba committed Feb 9, 2021
1 parent f9ed4f7 commit 29fa973
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source3/lib/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 29fa973

Please sign in to comment.