From: Gary Lockyer Date: Tue, 20 May 2025 21:10:28 +0000 (+1200) Subject: Fix clang 20 format-nonliteral warnings X-Git-Tag: tevent-0.17.0~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b664e511669db2e30f90427235ac79bf129af5c;p=thirdparty%2Fsamba.git Fix clang 20 format-nonliteral warnings Fix: /source3/utils/smbcacls.c:1619:35 error: format string is not a string literal [-Werror -Wformat-non-literal] Signed-off-by: Gary Lockyer Reviewed-by: Douglas Bagnall Reviewed-by: Anoop C S --- diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 31a20c812c5..a0ca191f465 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -844,7 +844,6 @@ int main(void) { conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True) conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=cast-align', testflags=True) conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=cast-qual', testflags=True) - conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=format-nonliteral', testflags=True) if Options.options.fatal_errors: conf.ADD_CFLAGS('-Wfatal-errors', testflags=True) diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 31065957355..430ee0b5974 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -1567,7 +1567,6 @@ static int write_dacl(struct dump_context *ctx, { struct security_descriptor *sd = NULL; char *str = NULL; - const char *output_fmt = "%s\r\n%s\r\n"; const char *tmp = NULL; char *out_str = NULL; uint8_t *dest = NULL; @@ -1616,7 +1615,7 @@ static int write_dacl(struct dump_context *ctx, if (tmp[0] == '\\') { tmp++; } - out_str = talloc_asprintf(frame, output_fmt, tmp, str); + out_str = talloc_asprintf(frame, "%s\r\n%s\r\n", tmp, str); if (out_str == NULL) { result = EXIT_FAILED;