From 9791e5817d5deecdde5e8a5350ad32e8898c5d44 Mon Sep 17 00:00:00 2001 From: Sergio Ammirata Date: Fri, 26 Jun 2026 08:15:57 -0400 Subject: [PATCH] fix(ristsender): split the usage string under the C99 4095-char limit (#219) Forwarded: https://code.videolan.org/rist/librist/-/work_items/219 Adding --blind-send to the help text pushed the single usage string literal past the 4095-character limit C99 requires a compiler to support, so a -Wpedantic -std=c99 -Werror build failed with -Woverlength-strings. Split the help text into two literals printed back to back; the output is unchanged. Thanks to Florian Ernst for the report. --- tools/ristsender.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ristsender.c b/tools/ristsender.c index b7fd0594..067c9457 100644 --- a/tools/ristsender.c +++ b/tools/ristsender.c @@ -174,7 +174,11 @@ const char help_str[] = "Usage: %s [OPTIONS] \nWhere OPTIONS are:\n" " | 1 = only non udp data is accepted (default) |\n" " | 2 = no data goes into or out of oob channel |\n" " -f | --fast-start value | Controls data output flow before handshake is completed |\n" -" -c | --config name.yaml | YAML config file |\n" +" -c | --config name.yaml | YAML config file |\n"; +// Split into two string literals: a single literal must stay under the +// C99 translation limit of 4095 chars (5.2.4.1). The two parts are +// printed back-to-back, so the help output is unchanged. +const char help_str2[] = //" | -1 = hold data out and igmp source joins |\n" " | 0 = hold data out |\n" " | 1 = start to send data immediately |\n" @@ -304,7 +308,7 @@ static void input_udp_sockerr(struct evsocket_ctx *evctx, int fd, short revents, static void usage(char *cmd) { - 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()); + 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()); exit(1); } -- GitLab