lkml.org 
[lkml]   [2004]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Totally broken PCI PM calls


On Mon, 11 Oct 2004, Pavel Machek wrote:
>
> Does sparse now have typechecking on enums?

You can mark an enum "bitwise" (by making all of it's values be
"bitwise"), and it will be considered a type of its own, yes. But then you
also cannot do arithmetic on it (which _usually_ is what you want, but not
necessarily always).

(You'd also need to pass in the "-Wbitwise" flag to sparse, to get the
checks).

By the time you mark something "bitwise", you don't even need to use an
enum, btw. You can just do a regular integer typedef and mark the typedef
to be "bitwise" - that generates a unique type right there. That's what
the endianness checking does.

Linus
-
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/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.074 / U:2.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site