]> Savannah Git Hosting - gnulib.git/commit
utimecmp: avoid new GCC 7 warning from -Wbool-operation
authorJim Meyering <meyering@fb.com>
Wed, 5 Oct 2016 16:13:55 +0000 (09:13 -0700)
committerJim Meyering <meyering@fb.com>
Wed, 5 Oct 2016 16:14:44 +0000 (09:14 -0700)
commitd7ccbff42ce581fac951d9ac1579f253e3cbd2e2
tree1c25a2f0907068d49a5ed3d64e65c96192900903
parentd0afb6a571e32baa432ad49c669ecd9f59434dec
utimecmp: avoid new GCC 7 warning from -Wbool-operation

Testing this module would fail when using GCC 7 like this:
$ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \
  --dir=/tmp/x --with-tests --test utimecmp
../../gllib/utimecmp.c: In function ‘utimecmp’:
../../gllib/utimecmp.c:291:36: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
                 time_t s = src_s & ~ (res == 2 * BILLION);
                                    ^
../../gllib/utimecmp.c:370:16: error: ‘~’ on a boolean expression \
  [-Werror=bool-operation]
       src_s &= ~ (res == 2 * BILLION);
                ^
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.
Instead, make it explicit that we intend to apply it to 0 or 1.
ChangeLog
lib/utimecmp.c