From: Aleksa Sarai Date: Thu, 2 Apr 2020 15:13:11 +0000 (+1100) Subject: cgroups: fix build warning on GCC 7 X-Git-Tag: lxc-5.0.0~472^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb0b8ab2d83eace642153626a5dd5ef04d6f749;p=thirdparty%2Flxc.git cgroups: fix build warning on GCC 7 GCC 7 appears to be clever enough to detect that transient_len is uninitialised but not that it won't be used despite [1]. Just initialise it to zero to stop the complaining, and allow LXC to build on openSUSE Leap. [1]: 346830421a96 ("cgroups: fix "uninitialized transient_len" warning") Signed-off-by: Aleksa Sarai --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 21c2c3f7c..d3595bcdf 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1360,7 +1360,7 @@ __cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops, __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops, struct lxc_handler *handler) { - int monitor_len, transient_len; + int monitor_len, transient_len = 0; char monitor[INTTYPE_TO_STRLEN(pid_t)], transient[INTTYPE_TO_STRLEN(pid_t)];