On Tue, Aug 25, 2015 at 12:43:38PM -0400, Konrad Rzeszutek Wilk wrote: > I am troubleshooting an locking issue and figured I would enable extra > options. > > But now I am hitting this build issue: > > domain.c:241: error: negative width in bit-field ‘<anonymous>’ > > Which is: > > 229 struct domain *alloc_domain_struct(void) > 230 { > 231 struct domain *d; > ... > 241 BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); >
In xen/include/xen/lib.h: 14 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 15 /* Force a compilation error if condition is true */ 16 #define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); }) 17 18 /* Force a compilation error if condition is true, but also produce a 19 result (of value 0 and type size_t), so the expression can be used 20 e.g. in a structure initializer (or where-ever else comma expressions 21 aren't permitted). */ 22 #define BUILD_BUG_ON_ZERO(cond) \ 23 sizeof(struct { _Static_assert(!(cond), "!(" #cond ")"); }) 24 #else 25 #define BUILD_BUG_ON_ZERO(cond) sizeof(struct { int:-!!(cond); }) 26 #define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond)) 27 #endif So you're using very old gcc and your struct domain is larger than 1 page. Wei. > Thoughts? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel