From 1ddc5ae3e49f6db7d4014600fb9713696d6e0f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 3 Mar 2026 00:18:09 +0100 Subject: [PATCH] notify: add one more compiler suppression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old gcc (<14) says: 2026-03-02T23:11:28.5676353Z In file included from ../src/notify/notify.c:30: 2026-03-02T23:11:28.5694607Z In function ‘strv_isempty’, 2026-03-02T23:11:28.5695481Z inlined from ‘action_fork’ at ../src/notify/notify.c:440:9, 2026-03-02T23:11:28.5696266Z inlined from ‘run’ at ../src/notify/notify.c:541:24, 2026-03-02T23:11:28.5696929Z inlined from ‘main’ at ../src/notify/notify.c:682:1: 2026-03-02T23:11:28.5697877Z ../src/basic/strv.h:108:23: error: ‘args’ may be used uninitialized [-Werror=maybe-uninitialized] 2026-03-02T23:11:28.5698655Z 108 | return !l || !*l; 2026-03-02T23:11:28.5699052Z | ^~ 2026-03-02T23:11:28.5700020Z ../src/notify/notify.c: In function ‘main’: 2026-03-02T23:11:28.5700681Z ../src/notify/notify.c:531:16: note: ‘args’ was declared here 2026-03-02T23:11:28.5701217Z 531 | char **args; 2026-03-02T23:11:28.5701574Z | ^~~~ 2026-03-02T23:11:28.5701960Z cc1: all warnings being treated as errors --- src/notify/notify.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/notify/notify.c b/src/notify/notify.c index d17df1eafa..5535296760 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -528,7 +528,7 @@ static int run(int argc, char* argv[]) { _cleanup_strv_free_ char **final_env = NULL; const char *our_env[10]; size_t i = 0; - char **args; + char **args = NULL; /* unnecessary initialization to appease gcc */ int r; log_setup(); @@ -536,6 +536,7 @@ static int run(int argc, char* argv[]) { r = parse_argv(argc, argv, &args); if (r <= 0) return r; + assert(args); if (arg_action == ACTION_FORK) return action_fork(args);