From 526d5dfac2c4ea95094944b15e652ff8259de89a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 28 Aug 2026 23:23:12 +0200 Subject: [PATCH 5/5] Silence warnings about unused global variables [pg_ctl] Several global variables are only used in Windows build. This patch marks these with an unused attribute to silence warnings. Alternatively, this code should perhaps be restricted to Windows more consistently. For example, currently you can use the -e option on any platform, but it only does something on Windows. --- src/bin/pg_ctl/pg_ctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index b5433a75d12..271d545da59 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -75,7 +75,7 @@ StaticAssertDecl(USECS_PER_SEC % WAITS_PER_SEC == 0, static bool do_wait = true; static int wait_seconds = DEFAULT_WAIT; -static bool wait_seconds_arg = false; +pg_attribute_unused() static bool wait_seconds_arg = false; static bool silent_mode = false; static ShutdownMode shutdown_mode = FAST_MODE; static int sig = SIGINT; /* default */ @@ -87,10 +87,10 @@ static char *post_opts = NULL; static const char *progname; static char *log_file = NULL; static char *exec_path = NULL; -static char *event_source = NULL; -static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */ -static char *register_username = NULL; -static char *register_password = NULL; +pg_attribute_unused() static char *event_source = NULL; +pg_attribute_unused() static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */ +pg_attribute_unused() static char *register_username = NULL; +pg_attribute_unused() static char *register_password = NULL; static char *argv0 = NULL; static bool allow_core_files = false; static time_t start_time; -- 2.55.0