From: Zbigniew Jędrzejewski-Szmek Date: Sun, 22 Jan 2023 17:21:13 +0000 (+0100) Subject: shared/install: rework an assert to appease gcc-13 X-Git-Tag: v253-rc1~33^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f5d716a71f1dfe50a2902a3ee3334b83c76d805;p=thirdparty%2Fsystemd.git shared/install: rework an assert to appease gcc-13 With the previous form, gcc is confused and thinks that .type might be unset. Fixes #26118. --- diff --git a/src/shared/install.c b/src/shared/install.c index 4eb15ca40e8..51cae3b5a2c 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -342,7 +342,8 @@ void install_changes_dump(int r, const char *verb, const InstallChange *changes, assert(verb || r >= 0); for (size_t i = 0; i < n_changes; i++) { - assert(verb || changes[i].type >= 0); + if (changes[i].type < 0) + assert(verb); assert(changes[i].path); /* When making changes here, make sure to also change install_error() in dbus-manager.c. */