[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON



On Mon, Sep 19, 2016 at 12:41:47PM +0100, Ian Jackson wrote:
> Wei Liu writes ("[PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON"):
> > The implementation is taken from libxc.
> ...
> > I could have put it in a header file accessible to all libraries under
> > libs but this construct is only relevant to xengnttab library at the
> > moment so it's put under gnttab/private.h. It can be easily moved to
> > a common place when other libraries under libs require it.
> 
> Other bits of tools already have this:
> 
> mariner:xen.git> git-grep -i 'define.*build_bug' tools | cat
> tools/firmware/hvmloader/util.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 
> - 2 * !!(p)]))
> tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), 
> "!(" #p ")"); })
> tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { 
> int:-!!(p); }))
> tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ({ _Static_assert(!(p), 
> "!(" #p ")"); })
> tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 
> * !!(p)]))
> mariner:xen.git> 
> 
> Do we really need to introduce yet another copy of this ?  Is gnttab
> not allowed to include xc_private.h ?  Is there not some one place
> where we could put this ?
> 

AIUI BUILD_BUG_ON is a private thing to each library, hence the
duplication. But I'm fine with having a central header for that, too.

If we want to share that macro across all libraries, we can create a
tools/include/private.h.  But that would require a fair bit of work --
adjust xen build system, fix stubdom build, fix mini-os etc -- which I
think it would be best to leave to me.

In the meantime, we should unblock Paulina on this one so that her
project can move forward.

Wei.

> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.