| 1 |
From 9791e5817d5deecdde5e8a5350ad32e8898c5d44 Mon Sep 17 00:00:00 2001 |
| 2 |
From: Sergio Ammirata <[email protected]> |
| 3 |
Date: Fri, 26 Jun 2026 08:15:57 -0400 |
| 4 |
Subject: [PATCH] fix(ristsender): split the usage string under the C99 |
| 5 |
4095-char limit (#219) |
| 6 |
Forwarded: https://code.videolan.org/rist/librist/-/work_items/219 |
| 7 |
|
| 8 |
Adding --blind-send to the help text pushed the single usage string |
| 9 |
literal past the 4095-character limit C99 requires a compiler to |
| 10 |
support, so a -Wpedantic -std=c99 -Werror build failed with |
| 11 |
-Woverlength-strings. Split the help text into two literals printed |
| 12 |
back to back; the output is unchanged. |
| 13 |
|
| 14 |
Thanks to Florian Ernst for the report. |
| 15 |
--- |
| 16 |
tools/ristsender.c | 8 ++++++-- |
| 17 |
1 files changed, 6 insertions(+), 2 deletions(-) |
| 18 |
|
| 19 |
diff --git a/tools/ristsender.c b/tools/ristsender.c |
| 20 |
index b7fd0594..067c9457 100644 |
| 21 |
--- a/tools/ristsender.c |
| 22 |
+++ b/tools/ristsender.c |
| 23 |
@@ -174,7 +174,11 @@ const char help_str[] = "Usage: %s [OPTIONS] \nWhere OPTIONS are:\n" |
| 24 |
" | 1 = only non udp data is accepted (default) |\n" |
| 25 |
" | 2 = no data goes into or out of oob channel |\n" |
| 26 |
" -f | --fast-start value | Controls data output flow before handshake is completed |\n" |
| 27 |
-" -c | --config name.yaml | YAML config file |\n" |
| 28 |
+" -c | --config name.yaml | YAML config file |\n"; |
| 29 |
+// Split into two string literals: a single literal must stay under the |
| 30 |
+// C99 translation limit of 4095 chars (5.2.4.1). The two parts are |
| 31 |
+// printed back-to-back, so the help output is unchanged. |
| 32 |
+const char help_str2[] = |
| 33 |
//" | -1 = hold data out and igmp source joins |\n" |
| 34 |
" | 0 = hold data out |\n" |
| 35 |
" | 1 = start to send data immediately |\n" |
| 36 |
@@ -304,7 +308,7 @@ static void input_udp_sockerr(struct evsocket_ctx *evctx, int fd, short revents, |
| 37 |
|
| 38 |
static void usage(char *cmd) |
| 39 |
{ |
| 40 |
- rist_log(&logging_settings, RIST_LOG_INFO, "%s\n%s version %s libRIST library: %s API version: %s\n", cmd, help_str, RISTSENDER_VERSION, librist_version(), librist_api_version()); |
| 41 |
+ rist_log(&logging_settings, RIST_LOG_INFO, "%s\n%s%s version %s libRIST library: %s API version: %s\n", cmd, help_str, help_str2, RISTSENDER_VERSION, librist_version(), librist_api_version()); |
| 42 |
exit(1); |
| 43 |
} |
| 44 |
|
| 45 |
-- |
| 46 |
GitLab |
| 47 |
|