|
|
|
Re: enum warning patch (was Re: Defect in linearization of short circuit &&) | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Tue February 16 2010 23:44:08 Christopher Li wrote: > Most simple enum declare has very small set of values. So naturally I > might want to use > some thing smaller than int type to store the enum value. I can't find > a good way to play > well with the enum warnings. > > If I use "char type" to store it. It trigger warning when you assign to it. > If I use "enum foo_type type:8" to store it, it will use int type > alignment and padding which > defeat the purpose of using a smaller type. > > Any suggestion? I don't think it's that easy to implement while keeping it enough generic. You need either a type able to store _any_ enum value, or a kind of type with variable size to keep it still working. The second seems like quite a lot of fuss over 4 bytes of memory. Kamil -- 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
[Newbies FAQ] [Kernel List] [Site Home] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [Bugtraq] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [DDR & Rambus] [Trinity Fuzzer Tool]