[lxc-devel] [lxc/lxc] 8560cd: conf: fix clang warning when building w/o libcap

GitHub noreply at github.com
Wed Mar 14 16:27:56 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 8560cd364bab452ed61d24df0674769b5a38de4a
      https://github.com/lxc/lxc/commit/8560cd364bab452ed61d24df0674769b5a38de4a
  Author: Igor Galić <igor.galic at automatic-server.com>
  Date:   2018-03-14 (Wed, 14 Mar 2018)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  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 at automatic-server.com>


  Commit: 55fc780b23031320b0358124a7d6ab152f90e0b7
      https://github.com/lxc/lxc/commit/55fc780b23031320b0358124a7d6ab152f90e0b7
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2018-03-14 (Wed, 14 Mar 2018)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  Merge pull request #2216 from igalic/fix/clang-warning

conf: fix clang warning when building w/o libcap


Compare: https://github.com/lxc/lxc/compare/0b628094f80a...55fc780b2303


More information about the lxc-devel mailing list