public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Introduce a global bool type
Date: Tue, 08 Jan 2013 18:49:20 +0100	[thread overview]
Message-ID: <20130108174920.BAB22202B69@gemini.denx.de> (raw)
In-Reply-To: <6AE080B68D46FC4BA2D2769E68D765B70820541F@039-SN2MPN1-023.039d.mgd.msft.net>

Dear Tabi Timur-B04825,

In message <6AE080B68D46FC4BA2D2769E68D765B70820541F@039-SN2MPN1-023.039d.mgd.msft.net> you wrote:
> >
> > This seems broken to me.  Can we rather try8 and get rid of all this
> > "bool" stuff instead?  It's just obfuscating the code...
> 
> Like Scott said, we sometimes copy code from Linux that uses 'bool',
> so it's simpler if we just retain this commonly-used type.  If it's
> part of the language, how is it obfuscating?  Maybe the Linux

_Bool has been introduced very late to any C standard, and you can
still see this from the ugly, unnatural name.

It is my personal firm conviction that the people pushed it were not
the ones who have been using C right from the beginning, say from the
times of Unix v6 or so.

IMHO it is much better to rely on '0' meaning "false" and anything
else meaning "true" instead of insisting on one specific value of
"true".  Yes, people claim the code is easier to read and understand,
but these are the same people who claim drop-down menues are easier to
work wit than a CLI.  And I've seen more than one case where bugs were
caused by using "proper bool types" like this:

	i = 0;
	j = 0;
	k = 2;

	if ((i | j | k) == true) ...


> developers should have used _Bool instead of bool, but they didn't,
> and so here we are.

Well, I raised my concerns, but I do not intend to formally NAK it.
In any case, I insist on using the standard header file.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Lispers are among  the  best  grads  of  the  Sweep-It-Under-Someone-
Else's-Carpet  School of Simulated Simplicity. [Was that sufficiently
incendiary? :-)]  - Larry Wall in <1992Jan10.201804.11926@netlabs.com

  reply	other threads:[~2013-01-08 17:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 22:10 [U-Boot] [PATCH] Introduce a global bool type York Sun
2013-01-07 22:29 ` Scott Wood
2013-01-07 22:32 ` [U-Boot] [u-boot-release] " Timur Tabi
2013-01-07 22:39 ` [U-Boot] " Wolfgang Denk
2013-01-07 22:50   ` Scott Wood
2013-01-07 22:54   ` Måns Rullgård
2013-01-08  6:25     ` Wolfgang Denk
2013-01-08 16:51   ` Tabi Timur-B04825
2013-01-08 17:49     ` Wolfgang Denk [this message]
2013-01-08 17:53       ` Timur Tabi
2013-01-08 19:07         ` Wolfgang Denk
2013-01-08 19:09           ` Timur Tabi
2013-01-08 19:56           ` York Sun
2013-01-08 21:39             ` Wolfgang Denk
2013-01-08 21:43               ` York Sun
2013-01-08 21:46                 ` Scott Wood
2013-01-19  9:30           ` Albert ARIBAUD
2013-01-21 18:05             ` Scott Wood
2013-01-21 22:36               ` Måns Rullgård
2013-01-21 22:51                 ` Scott Wood
2013-01-21 23:08                   ` Måns Rullgård
2013-01-22  7:41                     ` Albert ARIBAUD
2013-01-22 12:59                       ` Måns Rullgård
2013-01-08 18:34       ` Bernhard Walle
2013-01-08 19:08         ` Wolfgang Denk

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=20130108174920.BAB22202B69@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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