The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] C question for the historians
@ 2017-11-08 16:17 Arthur Krewat
  2017-11-08 16:27 ` Warner Losh
  2017-11-08 18:14 ` Ralph Corderoy
  0 siblings, 2 replies; 17+ messages in thread
From: Arthur Krewat @ 2017-11-08 16:17 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-11-09 10:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 16:17 [TUHS] C question for the historians 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 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).