Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbWCPKpS (ORCPT ); Thu, 16 Mar 2006 05:45:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752168AbWCPKpS (ORCPT ); Thu, 16 Mar 2006 05:45:18 -0500 Received: from smtp.osdl.org ([65.172.181.4]:60647 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1752069AbWCPKpQ (ORCPT ); Thu, 16 Mar 2006 05:45:16 -0500 Date: Thu, 16 Mar 2006 02:42:34 -0800 From: Andrew Morton To: Anton Altaparmakov Cc: linux-kernel@vger.kernel.org, len.brown@intel.com Subject: Re: [patch 1/1] consolidate TRUE and FALSE Message-Id: <20060316024234.103d37dc.akpm@osdl.org> In-Reply-To: References: <200603161004.k2GA46Fc029649@shell0.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1317 Lines: 57 Anton Altaparmakov wrote: > > > Various places are doing things like > > > > typedef { > > FALSE, > > TRUE > > } my_fave_name_for_a_bool; > > > > These are converted to > > > > typedef int my_fave_name_for_a_bool; > > Given that the kernel now requires gcc 3.2 or later, that already includes > a native boolean type (_Bool)? It does? Is it any good? bix:/home/akpm> cat t.c void foo() { _Bool b = 1; b += 2; } bix:/home/akpm> gcc -O -Wall -c t.c bix:/home/akpm> Sigh. > Why not use that instead of "int"? That'd be a separate patch ;) > Also contains: > > #define bool _Bool > #define true 1 > #define false 0 > > So we could take the bool rather than _Bool, too given _Bool looks > rather ugly... We have a couple of private bools and a couple of private 'true's and `false's so I guess it'd be a simple patch. I wonder if it would have any surprising side-effects. (I think using `bool' is a good thing - it makes the code more readable. It's a shame the compiler's handling of it is so useless). - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/