On 30/06/2021 07:42, Jan Beulich wrote: > In commit 90629587e16e ("x86/shadow: replace stale literal numbers in > hash_{vcpu,domain}_foreach()") I had to work around a clang shortcoming > (if you like), leveraging that gcc tolerates static const variables in > otherwise integer constant expressions. Roberto suggests that we'd > better not rely on such behavior. Drop the involved static const-s, > using their "expansions" in both of the prior use sites each. This then > allows dropping the short-circuiting of the check for clang. > > Requested-by: Roberto Bagnara <roberto.bagn...@bugseng.com> > Signed-off-by: Jan Beulich <jbeul...@suse.com>
It is not fair to categorise this as a shortcoming in clang. C mandates an ICE in _Static_assert(). You tried to used a GCC extension/implementation detail which Clang doesn't implement. With a suitable change to the commit message, Acked-by: Andrew Cooper <andrew.coop...@citrix.com>