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

Re: [Xen-devel] [PATCH v4 4/4] build: enable no-parentheses in clang



On Tue, Feb 14, 2017 at 06:56:12AM -0700, Jan Beulich wrote:
> >>> On 14.02.17 at 13:30, <roger.pau@xxxxxxxxxx> wrote:
> > --- a/Config.mk
> > +++ b/Config.mk
> > @@ -212,9 +212,6 @@ CFLAGS += -std=gnu99
> >  
> >  CFLAGS += -Wall -Wstrict-prototypes
> >  
> > -# Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
> > -CFLAGS-$(clang) += -Wno-parentheses
> 
> Taking the comment being removed here together with ....
> 
> > --- a/xen/arch/x86/traps.c
> > +++ b/xen/arch/x86/traps.c
> > @@ -2011,7 +2011,7 @@ uint32_t guest_io_read(unsigned int port, unsigned 
> > int bytes,
> >          {
> >              sub_data = pv_pit_handler(port, 0, 0);
> >          }
> > -        else if ( (port == RTC_PORT(0)) )
> > +        else if ( port == RTC_PORT(0) )
> >          {
> >              sub_data = currd->arch.cmos_idx;
> >          }
> > @@ -2080,7 +2080,7 @@ void guest_io_write(unsigned int port, unsigned int 
> > bytes, uint32_t data,
> >          {
> >              pv_pit_handler(port, (uint8_t)data, 1);
> >          }
> > -        else if ( (port == RTC_PORT(0)) )
> > +        else if ( port == RTC_PORT(0) )
> >          {
> >              currd->arch.cmos_idx = data;
> >          }
> 
> ... the code adjustments all being to other than macros I wonder
> whether in the version you use the issue is no longer being
> reported in macro expansions, but older clang still chokes on such.
> Or did you go check that we have no such uses left (which seems
> unlikely to me)?

I assume that in recent versions of clang this is no longer an issue. Travis
tests with clang 3.5 and I test with 3.8, and none of them find any issues.
IMHO we should turn it on because I barely doubt anyone is building Xen with
older versions of clang, when I started working on this the clang support was
completely bitrotted.

Roger.

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