The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: imp@bsdimp.com (Warner Losh)
Subject: [TUHS] C question for the historians
Date: Wed, 8 Nov 2017 13:36:40 -0700	[thread overview]
Message-ID: <CANCZdfrHzwDzTBuCy5ofBqq8ZentXQP1Fjs32ZKt_99fJBsVTA@mail.gmail.com> (raw)
In-Reply-To: <20171108190540.GA7241@mcvoy.com>

On Wed, Nov 8, 2017 at 12:05 PM, Larry McVoy <lm at mcvoy.com> wrote:

> On Wed, Nov 08, 2017 at 06:14:20PM +0000, Ralph Corderoy wrote:
> > is better then why stop there?  Why not
> >
> >     if (((w & MASK) != FALSE) == TRUE)
>
>
> Thanks for this, that's the perfect come back to the pedantic folks.
>

It's also wrong. You couldn't flip it around to write

 if (((w & MASK) == TRUE) == TRUE)

because that only works when MASK == 1. So it's dangerous since you can't
apply the normal laws of algebra on it because you are comparing BOOLEANS
and MASKS, which has always ended in pain...

Warner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20171108/d90d3972/attachment.html>


      parent reply	other threads:[~2017-11-08 20:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 16:17 Arthur Krewat
2017-11-08 16:27 ` Warner Losh
2017-11-09 10:17   ` Michael Kjörling
2017-11-08 18:14 ` Ralph Corderoy
2017-11-08 18:34   ` Arthur Krewat
2017-11-08 19:05   ` Larry McVoy
2017-11-08 20:13     ` ron minnich
2017-11-08 20:23       ` Larry McVoy
2017-11-08 20:32         ` Ron Natalie
2017-11-08 20:39       ` Warner Losh
2017-11-08 20:41       ` Chet Ramey
2017-11-09  1:22         ` Ralph Corderoy
2017-11-09  1:41           ` Chet Ramey
2017-11-09  1:49             ` Arthur Krewat
2017-11-08 20:43       ` Bakul Shah
2017-11-08 20:55       ` Steve Nickolas
2017-11-08 20:36     ` Warner Losh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANCZdfrHzwDzTBuCy5ofBqq8ZentXQP1Fjs32ZKt_99fJBsVTA@mail.gmail.com \
    --to=imp@bsdimp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).