GNU bug report logs - #48516
diff.c:764: possible wrong operator ?

Previous Next

Package: diffutils;

Reported by: David Binderman <dcb314 <at> hotmail.com>

Date: Wed, 19 May 2021 10:23:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: David Binderman <dcb314 <at> hotmail.com>
To: 48516 <at> debbugs.gnu.org
Subject: bug#48516: diff.c:764: possible wrong operator ?
Date: Wed, 19 May 2021 10:07:08 +0000
Hello there,

I just tried to compile diffutils-3.7 with clang. It said:

diff.c:764:8: warning: bitwise negation of a boolean expression; did you mean logical negation? [-Wbool-operation]

Source code is

  files_can_be_treated_as_binary =
    (brief & binary
     & ~ (ignore_blank_lines | ignore_case | strip_trailing_cr
          | (ignore_regexp_list.regexps || ignore_white_space)));

Maybe better code:

  files_can_be_treated_as_binary =
    (brief & binary
     & ! (ignore_blank_lines | ignore_case | strip_trailing_cr
          | (ignore_regexp_list.regexps || ignore_white_space)));

Regards

David Binderman







This bug report was last modified 4 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.