RE: [PATCH next v2 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness.

From: David Laight
Date: Tue Aug 01 2023 - 04:45:20 EST


From: kernel test robot
> Sent: 31 July 2023 22:44
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on akpm-mm/mm-everything]
> [also build test ERROR on linus/master crng-random/master v6.5-rc4 next-20230731]
> [cannot apply to next-20230728]
...
> compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git
> f28c006a5895fc0e329fe15fead81e37457cb1d1)
> reproduce: (https://download.01.org/0day-ci/archive/20230801/202308010559.SEtfkzQU-
> lkp@xxxxxxxxx/reproduce)
>
....
> >> drivers/gpu/drm/drm_modes.c:2474:15: error: static_assert expression is not an integral constant
> expression
> extra_ptr = max(bpp_end_ptr, refresh_end_ptr);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is really a bug in clang - fixed in 16.0.0.
In C (but probably not C++) '(void *)1' should be a compile-time constant.
Will be fixed in v3 of the patch.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)