All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] standardizing on boolean variables?
@ 2007-01-21  8:36 Robert P. J. Day
  2007-01-21  9:02 ` Alexey Dobriyan
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Robert P. J. Day @ 2007-01-21  8:36 UTC (permalink / raw)
  To: kernel-janitors


  how hard would it be to define a standard for a simple true/false
boolean variable for the kernel?  gcc has had support for the C99
"_Bool" type for years, and additionally defines, in
include/linux/types.h:

  typedef _Bool                   bool;

so there's no reason to not use "bool" anywhere you need an actual
boolean, is there?

  however, it seems everyone wants to define their own macros for
the actual values "true" and "false":

  $ grep -r "define TRUE" .
  $ grep -r "define FALSE" .

yeesh.  would there be a problem adding those two defines to
"types.h", then deleting all those additional macro definitions?

  one might also get rid of redundant typedefs like:

  $ grep -r "typedef.*bool" .

where people insist on re-inventing their own booleans types.

rday

p.s.  the source file drivers/scsi/BusLogic.c repeatedly refers to the
token "true", but it's not clear where *that's" being defined.  goes
gcc actually recognize the token "true"?  that's supposed to be
defined in C99's <stdbool.h>, but that's clearly not being used here.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-01-22 10:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-21  8:36 [KJ] standardizing on boolean variables? Robert P. J. Day
2007-01-21  9:02 ` Alexey Dobriyan
2007-01-21  9:30 ` Robert P. J. Day
2007-01-21 10:36 ` Tobias Klauser
2007-01-21 10:58 ` Richard Knutsson
2007-01-21 11:30 ` Robert P. J. Day
2007-01-21 11:54 ` Robert P. J. Day
2007-01-21 12:29 ` Richard Knutsson
2007-01-21 12:47 ` Robert P. J. Day
2007-01-22  8:08 ` Robert P. J. Day
2007-01-22  9:03 ` Richard Knutsson
2007-01-22  9:15 ` Robert P. J. Day
2007-01-22 10:00 ` Robert P. J. Day

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.