On Fri, Sep 7, 2018 at 5:01 PM Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > > In the kernel, some enums are defined with such bitwise types > as initializers; the goal being to have slightly more strict enums. > While the semantic of such enums is not very clear, using a mix > of bitwise and not-bitwise initializers completely defeats the > desired stricter typing. Hmm. We consider 0 to be special, in that it matches all bitwise types. So typedef long long __bitwise bits; enum a { one = 0, two = (__force bits) 1, }; feels like it should work (and result in everything being of type "bits"), but looking at this patch I suspect it results in a warning. Note! Just reading the patch, not actually testing it. Linus