]> git.ipfire.org Git - thirdparty/lxc.git/commit
conf: fix clang warning when building w/o libcap 2216/head
authorIgor Galić <igor.galic@automatic-server.com>
Wed, 14 Mar 2018 15:53:24 +0000 (16:53 +0100)
committerIgor Galić <igor.galic@automatic-server.com>
Wed, 14 Mar 2018 16:01:39 +0000 (17:01 +0100)
commit8560cd364bab452ed61d24df0674769b5a38de4a
tree9ba8410908cba22e8d9b9b4128dfc3a2a7df881f
parent0b628094f80a038aa6b31e9e3b6401f378073478
conf: fix clang warning when building w/o libcap

when compiling lxc with clang-5.0 parse_cap()'s main loop will produce a
warning about a tautological comparision (#2215).

By moving the result of computation into a variable (end) this is no
longer a constant expression. clang-5.0 does not do dataflow analysis at
this point, so it is, to quote someone from #llvm, "morally equivalent"
to casting `(int)i`.

in addition, we also clean up the #if HAVE_LIBCAP to no longer need
its #else branch!

Signed-off-by: Igor Galić <igor.galic@automatic-server.com>
src/lxc/conf.c