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

Re: [XEN PATCH v7 01/51] build: introduce cpp_flags macro


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Mon, 6 Sep 2021 11:06:01 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Tim Deegan" <tim@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 06 Sep 2021 10:06:17 +0000
  • Ironport-hdrordr: A9a23:AGu+uavt4251vxZfbGl7V1O47skDdtV00zEX/kB9WHVpmszxra 6TddAgpHvJYVcqKRQdcL+7VZVoLUmxyXcx2/h3AV7AZniFhILLFuFfBOLZqlWKcREWtNQttp uIG5IObuEYZmIasS+V2maFL+o=
  • Ironport-sdr: So0UWvXWJbMpiG7Qti2/no7YCzlCG/49Hbao8u9m0kWwGa0lkGO5dvExafKxklAzj6OIWJamLg cp8/WRGR8mmTOnsMmWeFPRem/SIRvIqxXhQlaNtBpdnRTlGed76w2mPf2U5QL0msZnaYmANnsh Bciibf9T7J6C6ZsT/cv4YyO1XNErb0FJvTrKxPQSje3IBPOWRlR9upE5+nzu4vJ21rcZ9c/ywK CizNEtVFksmMTBKez0xygl1B+nroj0HtV5W71BMYJs8AocF9ixeEsMlfJ/LWf0DKPSYXkA3IM4 0FJk65YWwePoNZZvCarQLjN7
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Sep 02, 2021 at 12:08:58PM +0200, Jan Beulich wrote:
> On 24.08.2021 12:49, Anthony PERARD wrote:
> > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> albeit with a remark:
> 
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -133,6 +133,9 @@ endif
> >  # Always build obj-bin files as binary even if they come from C source. 
> >  $(obj-bin-y): XEN_CFLAGS := $(filter-out -flto,$(XEN_CFLAGS))
> >  
> > +# To be use with $(a_flags) or $(c_flags) to produce CPP flags
> > +cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
> 
> Afaics this has nothing to do with Linux'es cpp_flags, so what we do here
> is entirely up to us. If this is strictly intended to be used the another
> macro, wouldn't it make sense to have
> 
> cpp_flags = $(filter-out -Wa$(comma)% -flto,$($(1)))
> 
> here and then e.g. ...
> 
> > @@ -222,13 +225,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): 
> > %.init.o: %.o FORCE
> >     $(call if_changed,obj_init_o)
> >  
> >  quiet_cmd_cpp_i_c = CPP     $@
> > -cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
> > +cmd_cpp_i_c = $(CPP) $(call cpp_flags,$(c_flags)) -MQ $@ -o $@ $<
> 
> ... the slightly simpler / easier to read
> 
> cmd_cpp_i_c = $(CPP) $(call cpp_flags,c_flags) -MQ $@ -o $@ $<
> 
> here?

I don't think this is better or simpler. "cpp_flags" don't need to know
the name of the variable to be useful. I think it is better to know that
"cpp_flags" act on the value of the variable rather than the variable
itself, when reading "$(call cpp_flags, $(a_flags))".

But thanks for the suggestion, and for the review,

-- 
Anthony PERARD



 


Rackspace

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