notify: add one more compiler suppression

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
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-03-23 14:20:10 +01:00
parent 8b89c6a64b
commit 1ddc5ae3e4
+2 -1
View File
@@ -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);