From: Wolfgang Denk Date: Tue, 08 Jan 2013 20:07:15 +0100 Subject: [U-Boot] [PATCH] Introduce a global bool type In-Reply-To: <50EC5D29.1070408@freescale.com> References: <1357596628-27501-1-git-send-email-yorksun@freescale.com> <20130107223942.94BED20DA7E@gemini.denx.de> <6AE080B68D46FC4BA2D2769E68D765B70820541F@039-SN2MPN1-023.039d.mgd.msft.net> <20130108174920.BAB22202B69@gemini.denx.de> <50EC5D29.1070408@freescale.com> Message-ID: <20130108190715.D2D14202B69@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Timur Tabi, In message <50EC5D29.1070408@freescale.com> you wrote: > > > _Bool has been introduced very late to any C standard, and you can > > still see this from the ugly, unnatural name. > > It was introduced in C99, which is over 12 years old. And how old is C? I think the "official" announcment was 1972, so that's more than twice as long without that addition. > > 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) ... > > Ok, but this is just wrong. i, j, and k are not boolean types, so they > should not be compared with 'true' or 'false'. I don't think you'll find > any disagreement with that. You are right. And I wrote that it's a bug. But this is what you can easily get from using boolean types. This is example has not been invented by me. I don't even claim that this was good programming style - all I want to say is that from what I have seen the boolean types are not a panacea; they cause new problems as well. 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 A modem is a baudy house.