]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgroups: fix -Waddress warning
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 01:27:57 +0000 (12:27 +1100)
committerAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 03:33:20 +0000 (14:33 +1100)
commit2a9743bba63903b66331b0b90fe2c25784585b89
treef68857611afb8e9e28e5339e6f0cb5c157adae3b
parente510d6bd870c15fc509477343cb1268b9726caa6
cgroups: fix -Waddress warning

While in principle the pointer could overflow, GCC 12 considers this to
not be possible and issues the following warning:

  ../src/lxc/cgroups/cgfsng.c: In function ‘__cgfsng_delegate_controllers’:
  ../src/lxc/cgroups/cgfsng.c:3306:21: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘it + 8’ must not be NULL [-Waddress]
   3306 |                 if ((it + 1) && *(it + 1))
        |                     ^

This removes the only build warning triggered when building on openSUSE.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
src/lxc/cgroups/cgfsng.c