Re: Booleans, what a wonderful type!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 18, 2007 at 03:43:39AM +0200, ricknu-0@xxxxxxxxxxxxxx wrote:
> Good morning to you all!
> 
> As most of you do not know, I am on Google's SoC
> <http://code.google.com/soc/2007/sparse/appinfo.html?csaid=CB0974F67B64AD0C> to
> add the ability to suggestions when booleans could/should be used.

Er...  Of _course_ booleans are values.  And yes, you can say true + false.
Guaranteed to evaluate to int, value of expression being 1.  It's perfectly
correct C99.  Same as true + true is guaranteed to be 2 (int, again); assigning
that to _Bool variable is guaranteed to give 1, aka true (see the rules
for conversion to _Bool).

Now, sparse handling of _Bool sucks in quite a few places (e.g. conversion
to it is not reduction modulo 2, it's comparison with 0), but I wonder if
that's what you have in mind...
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux