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

To reply to this bug, email your comments to 48516 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#48516; Package diffutils. (Wed, 19 May 2021 10:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Binderman <dcb314 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Wed, 19 May 2021 10:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Binderman <dcb314 <at> hotmail.com>
To: "bug-diffutils <at> gnu.org" <bug-diffutils <at> gnu.org>
Subject: 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 3 years and 192 days ago.

Previous Next


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