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

Re: [Xen-devel] [PATCH v3] dom0-build: fix build with clang5



On 23.01.2020 12:36, Jan Beulich wrote:
> With non-empty CONFIG_DOM0_MEM clang5 produces
> 
> dom0_build.c:344:24: error: use of logical '&&' with constant operand 
> [-Werror,-Wconstant-logical-operand]
>     if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] )
>                        ^  ~~~~~~~~~~~~~~~~~~
> dom0_build.c:344:24: note: use '&' for a bitwise operation
>     if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] )
>                        ^~
>                        &
> dom0_build.c:344:24: note: remove constant to silence this warning
>     if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] )
>                       ~^~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> 
> Obviously neither of the two suggestions are an option here. Oddly
> enough swapping the operands of the && helps, while e.g. casting or
> parenthesizing doesn't. Another workable variant looks to be the use of
> !! on the constant.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Acked-by: Julien Grall <julien@xxxxxxx>
> Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Btw, rather than keeping the issue unfixed, I think I'll commit this
within the next couple of days, unless I hear an explicit objection
accompanied by an alternative suggestion better than the strlen()
one. Of course an ack by you would be much appreciated and even
better.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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