* struct/union attributes placement
@ 2006-11-29 19:07 Randy Dunlap
0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2006-11-29 19:07 UTC (permalink / raw)
To: linux-sparse
In 2.6.19-rc6-mm2, kvm places struct attributes between
"struct" and the struct name (in drivers/kvm/kvm_main.c):
void fx_init(struct kvm_vcpu *vcpu)
{
struct __attribute__ ((__packed__)) fx_image_s {
u16 control; //fcw
u16 status; //fsw
u16 tag; // ftw
u16 opcode; //fop
u64 ip; // fpu ip
u64 operand;// fpu dp
u32 mxcsr;
u32 mxcsr_mask;
} *fx_image;
This is legal gcc according to
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Type-Attributes.html#Type-Attributes
but sparse complains about it (and following usage statements):
drivers/kvm/kvm_main.c:473:9: error: Trying to use reserved word '__attribute__' as identifier
drivers/kvm/kvm_main.c:473:38: error: Expected ; at end of declaration
drivers/kvm/kvm_main.c:473:38: error: got fx_image_s
drivers/kvm/kvm_main.c:485:14: error: Expected ) in function declarator
drivers/kvm/kvm_main.c:485:14: error: got ->
drivers/kvm/kvm_main.c:487:14: error: Expected ) in function declarator
drivers/kvm/kvm_main.c:487:14: error: got ->
drivers/kvm/kvm_main.c:488:17: error: Expected ) in function declarator
drivers/kvm/kvm_main.c:488:17: error: got ->
drivers/kvm/kvm_main.c:491:10: error: Expected ; at end of declaration
drivers/kvm/kvm_main.c:491:10: error: got ->
drivers/kvm/kvm_main.c:492:13: error: Expected ) in function declarator
drivers/kvm/kvm_main.c:492:13: error: got ->
drivers/kvm/kvm_main.c:494:1: error: Expected ; end of type declaration
drivers/kvm/kvm_main.c:494:1: error: got }
drivers/kvm/kvm_main.c:490:2: error: symbol 'fx_image' redeclared with different type (originally declared at drivers/kvm/kvm_main.c:483) - different base types
drivers/kvm/kvm_main.c:491:2: error: symbol 'fx_image' redeclared with different type (originally declared at drivers/kvm/kvm_main.c:483) - different base types
---
~Randy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-29 19:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 19:07 struct/union attributes placement Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).