]> git.proxmox.com Git - mirror_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>
Sun, 30 Oct 2022 13:07:53 +0000 (00:07 +1100)
commitbc318926d701befde030b77948c343bb337b0713
tree35e3378ef3a57bcc27fa248b1e12c36369d654de
parentfbed9bb75980e96c18c02924d6584a5660e186ac
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