lkml.org 
[lkml]   [2021]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [BUG] [5.15] Compilation error in arch/x86/kvm/mmu/spte.h with clang-14
From
Date


> On 14 Oct 2021, at 22:50, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 14/10/21 21:06, Nick Desaulniers wrote:
>>> If we want to fix this, my vote is for casting to an int and updating the comment
>> At the least, I think bitwise operations should only be performed on
>> unsigned types.
>
> This is not a bitwise operation, it's a non-short-circuiting boolean operation. I'll apply Jim's suggestion.

What about making it an inline function, which would require evaluation of arguments:

static __always_inline bool BITWISE_BOOLEAN_OR(bool a, bool b)
{
return a || b; // Safe here, because arguments have been evaluated
}

Suggesting that because I'm always nervous about casts in macros hiding something that the type system would otherwise catch.


Christophe
>
> Paolo
>

\
 
 \ /
  Last update: 2021-10-15 11:18    [W:0.527 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site