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

Re: [Xen-devel] [PATCH v5 2/4] xen: introduce a C99 headers check



On Wed, 29 Mar 2017, Jan Beulich wrote:
> >>> On 29.03.17 at 00:08, <sstabellini@xxxxxxxxxx> wrote:
> > Introduce a C99 headers check, for non-ANSI compliant headers: 9pfs.h
> > and pvcalls.h.
> > 
> > In addition to the usual -include stdint.h, also add -include string.h
> > to the C99 check to get the declaration of memcpy and size_t.
> 
> No, as explained before. You shouldn't think of just your new headers,
> but others which may later join the party.
> 
> > --- a/xen/include/Makefile
> > +++ b/xen/include/Makefile
> > @@ -90,11 +90,16 @@ compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) 
> > Makefile
> >  
> >  ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
> >  
> > -all: headers.chk headers++.chk
> > +all: headers.chk headers99.chk headers++.chk
> >  
> >  PUBLIC_HEADERS := $(filter-out public/arch-% public/dom0_ops.h, $(wildcard 
> > public/*.h public/*/*.h) $(public-y))
> >  
> > -PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% 
> > public/%hvm/save.h, $(PUBLIC_HEADERS))
> > +PUBLIC_C99_HEADERS :=
> > +PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% 
> > public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS))
> > +
> > +EXTRA_PREREQ_C99 := -include string.h
> > +EXTRA_PREREQ_CPP := -include cstring
> 
> These should be per header, e.g.
> 
> pvcalls.h-c99-prereq := string.h
> pvcalls.h-cxx-prereq := cstring
> 
> which will also (I think at least) greatly simplify the adjustments
> needed further down).
> 
> Implied from this - please don't use CPP for C++, as CPP is commonly
> used for the preprocessor.

I can try, but it requires changing the loops below from bash to
Makefile ($(foreach)) to handle variable expansions properly. It's not a
trivial change and it decreases readability, see the new version of the
series that I am about to send. If it was up to me I would probably keep
the code as is in this version.

_______________________________________________
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®.