Re: [RFC][PATCH] A generic boolean (version 3)

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

 



Citerar Lars Gullik Bjønnes <[email protected]>:

> [email protected] writes:
> 
> | --- a/include/asm-i386/types.h
> | +++ b/include/asm-i386/types.h
> | @@ -1,6 +1,13 @@
> |  #ifndef _I386_TYPES_H
> |  #define _I386_TYPES_H
> |  
> | +#if __GNUC__ >= 3
> | +typedef _Bool bool;
> | +#else
> | +#warning You compiler doesn't seem to support boolean types, will set
> 'bool' as
> | an 'unsigned int'
> | +typedef unsigned int bool;
> | +#endif
> | +
> 
> What does C99 say about sizeof(_Bool)?
> 
> At least with gcc 4 it is 1. Can that pose a problem? gcc < 3 giving a
> different size for bool?

Well, it might. I don't see it other then when someone uses a variable of
another type and the "boolean" variable (now an int) is of a larger value then
that variable. But then that is a bug and should be fixed.

But rest easy, bool will only be _Bool from now on. :)

> -- 
> 	Lgb

Richard Knutsson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux