All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] standardizing on boolean variables?
Date: Sun, 21 Jan 2007 10:36:56 +0000	[thread overview]
Message-ID: <20070121103656.GU31196@distanz.ch> (raw)
In-Reply-To: <Pine.LNX.4.64.0701210324380.13751@CPE00045a9c397f-CM001225dbafb6>

On 2007-01-21 at 09:36:33 +0100, Robert P. J. Day <rpjday@mindspring.com> wrote:
>   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.

There was an effort by Andrew Morton [1] to clean this up some time ago.
AFAIR the patch wasn't accepted but I don't remember the exact reason.

[1] http://marc2.theaimsgroup.com/?l=linux-kernel&m\x114250357613993&w=2

Cheers,
Tobias
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2007-01-21 10:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20070121103656.GU31196@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=kernel-janitors@vger.kernel.org \
    /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 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.