The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: krewat@kilonet.net (Arthur Krewat)
Subject: [TUHS] C question for the historians
Date: Wed, 8 Nov 2017 11:17:40 -0500	[thread overview]
Message-ID: <bd0bd6ba-ef3d-768f-6ae1-89240dff165c@kilonet.net> (raw)

 From a mailing list I belong to, a back-and-forth is going on that I am 
not involved in. The following sums it up nicely:

> It's really the implied equality that's the problem.  For example:
> 
>     if (flags & DLADM_OPT_PERSIST) {
> 
> would be better written as:
> 
>     if ((flags & DLADM_OPT_PERSIST) == 0) {



Seriously? What do (or would) "original C" programmers think of this? To me, anything non-zero is "true" so the first is perfectly acceptable.

The original assertion in the discussion was that the following is not "right" because of the mixing of bitwise and boolean.

> if ((flags & DLADM_OPT_PERSIST) && (link_flags & DLMGMT_PERSIST)) {

art k.



             reply	other threads:[~2017-11-08 16:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 16:17 Arthur Krewat [this message]
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

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=bd0bd6ba-ef3d-768f-6ae1-89240dff165c@kilonet.net \
    --to=krewat@kilonet.net \
    /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).