]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Move to -Wformat=2 checking in Linux
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Tue, 30 Dec 2025 18:52:01 +0000 (18:52 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Tue, 30 Dec 2025 18:52:01 +0000 (18:52 +0000)
Makefile.am
player.c
rtsp.c

index 295370a3279c8d229493782d3f3aa21cb31427e9..8c70fd6fe7786b3c895311fed7c52e240bb501a7 100644 (file)
@@ -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
index 2f065db8f5a0ab4b3ab222477d8696e918962d32..5fe3533e75b98d0ef493df9b3e5d2f6856fcb093 100644 (file)
--- 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 722fced247f28da864721874b37df9e2d89a1529..d11f4ba81587d9b1f4482e35fcc408453a4b1f3c 100644 (file)
--- 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;
   }