On Mon, Jul 15, 2019 at 4:36 AM Jan Beulich <jbeul...@suse.com> 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 <jbeul...@suse.com>
> ---
> I'm open to going the !! or yet some different route. No matter which
> one we choose, I'm afraid it is going to remain guesswork what newer
> (and future) versions of clang will choke on.

Is disabling the check itself not an option? Seems to me to be a more
sensible option then hacking around it.

Tamas

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

Reply via email to