On Dec 6, 2007 6:54 PM, Andi Kleen <ak@suse.de> wrote:
It is an anonymous union.
However:
* It's an union of structs
* I wished to keep the toplevel type as a struct
The alternative would be to write:
struct desc_struct {
union {
struct { unsigned int a, b; };
struct {
u16 limit0;
u16 base0;
unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 :8;
};
};
};
Which is fine, it's all the same in the end. Just with more shift
rights, and more visual pollution.
--
Glauber de Oliveira Costa.
"Free as in Freedom"
http://glommer.net
"The less confident you are, the more serious you have to act."
--