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

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


  • To: Tamas K Lengyel <tamas.k.lengyel@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 15 Jul 2019 14:13:39 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MZFypzeExzbM7rS6y1OHI8Ide7Re/IOEEM1u/Fx/Xq8=; b=QKeHBMN/ukP3yJNDG7uw5iNcGJyMu5us9l6hQbuNJYfZFGwt6avbHIKDIAMTSNwisGfcMfQE8Den/q0K8EiOoBeafNwgF7wc6F36HJhmkFmqyeWuWZ7sdwCndvR0tXdOKvX5yXzwyWOtvaG6lM+ZvWRDpKz5U5jcZxkQKz+9/9HC5VYDjm/M1NYwCdYQx3tnFWUgSDvJSta90EsdvyFZEREufLEMa2GAcItRdkfzzZk0Zy5+CZIGWoW4jhlyySqNm9JixOv0CkWc+6AdnICVGgfNPeI3AoXbSbS3wtLiiAMA2HS+eptumsCuFJme8P//mSGCkc+4o9xhaBGfmLitfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SdvyrfqsmEvJq74WONx0k1Qk+EW/VKFChqLXI1GHCMUSBImQ7ylfQ63JaCEHR4k95Bo5ghNkRNKhaPKilloPZnfUBKiV8TCHoX2MYndVo6Tuxmxb/XeNP5KyQz5brd3pvvM9AtnEMQ/i9mEAHzmUwiXYp5qVNGNKNJLZasJWAIbfBj+azokGfzkmNsbGKO2ys4Nn2VGfsp4xw/3+gd6DKVWO6BFbW1npbGg0MNWLgQDoPMLhtJwfuEx3EnILhxrVNgxjwiK5lAxt5a+3E0X3lFsKXSYCJNRVSurxjtmJFFLBKInqON3zbHa/cba61WoockrjK7WC01EmmFmCe1CLeA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 15 Jul 2019 14:13:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVOxeAOJS35VCb3EmrxBvoPUkIQA==
  • Thread-topic: [PATCH] x86/dom0-build: fix build with clang5

On 15.07.2019 15:41, Tamas K Lengyel wrote:
> On Mon, Jul 15, 2019 at 4:36 AM Jan Beulich <JBeulich@xxxxxxxx> 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>
>> ---
>> 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.

How would you envision to disable the check? It's there for a reason
after all.

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