From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 30 Dec 2025 18:52:01 +0000 (+0000) Subject: Move to -Wformat=2 checking in Linux X-Git-Tag: 5.0-post-dev~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d148f026a2f81a5d652b50bb53e45623ed78a60;p=thirdparty%2Fshairport-sync.git Move to -Wformat=2 checking in Linux --- diff --git a/Makefile.am b/Makefile.am index 295370a3..8c70fd6f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,8 +41,8 @@ if BUILD_FOR_OPENBSD AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" AM_CFLAGS = --include=utilities/debug.h -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" else - AM_CXXFLAGS = -Wshadow -fno-common -Wno-multichar -Wall -Wextra -Wformat -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" - AM_CFLAGS = --include=utilities/debug.h -Wshadow -fno-common -Wno-multichar -Wall -Wextra -Wformat -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" + AM_CXXFLAGS = -Wshadow -fno-common -Wno-multichar -Wall -Wextra -Wformat -Wformat=2 -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" + AM_CFLAGS = --include=utilities/debug.h -Wshadow -fno-common -Wno-multichar -Wall -Wextra -Wformat -Wformat=2 -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" endif endif endif diff --git a/player.c b/player.c index 2f065db8..5fe3533e 100644 --- a/player.c +++ b/player.c @@ -4084,7 +4084,7 @@ void *player_thread_func(void *arg) { statistics_column = statistics_column + 2; } statistics_row++; - inform(line_of_stats); + inform("%s", line_of_stats); } while (statistics_row < 2); } else { inform("No frames received in the last sampling interval."); diff --git a/rtsp.c b/rtsp.c index 722fced2..d11f4ba8 100644 --- a/rtsp.c +++ b/rtsp.c @@ -873,7 +873,7 @@ void _debug_log_rtsp_message(const char *filename, const int linenumber, int lev if (level > debug_level()) return; if ((prompt) && (*prompt != '\0')) // okay to pass NULL or an empty list... - _debug(filename, linenumber, level, prompt); + _debug(filename, linenumber, level, "%s", prompt); _debug_print_msg_headers(filename, linenumber, level, message); #ifdef CONFIG_AIRPLAY_2 char *plist_content = rtsp_plist_content(message); @@ -963,7 +963,7 @@ ssize_t write_encrypted(int fd, pair_cipher_bundle *ctx, const void *buf, size_t ssize_t ret = pair_encrypt(&encrypted, &encrypted_len, buf, count, ctx->cipher_ctx); if (ret < 0) { - debug(1, pair_cipher_errmsg(ctx->cipher_ctx)); + debug(1, "%s", pair_cipher_errmsg(ctx->cipher_ctx)); return -1; } @@ -2076,7 +2076,7 @@ void handle_pair_verify(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *r ret = pair_verify(&body, &body_len, conn->ap2_pairing_context.verify_ctx, (const uint8_t *)req->content, req->contentlength); if (ret < 0) { - debug(1, pair_verify_errmsg(conn->ap2_pairing_context.verify_ctx)); + debug(1, "%s", pair_verify_errmsg(conn->ap2_pairing_context.verify_ctx)); resp->respcode = 470; // Connection Authorization Required goto out; } @@ -2142,7 +2142,7 @@ void handle_pair_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *re ret = pair_setup(&body, &body_len, conn->ap2_pairing_context.setup_ctx, (const uint8_t *)req->content, req->contentlength); if (ret < 0) { - debug(1, pair_setup_errmsg(conn->ap2_pairing_context.setup_ctx)); + debug(1, "%s", pair_setup_errmsg(conn->ap2_pairing_context.setup_ctx)); resp->respcode = 470; // Connection Authorization Required goto out; }