Re: [Intel-gfx] [PATCH v4] overflow: Introduce overflows_type() and castable_to_type()

2022-10-21 Thread Nathan Chancellor
Hi Gwan-gyeong, On Fri, Oct 21, 2022 at 11:33:33AM +0300, Gwan-gyeong Mun wrote: > From: Kees Cook > > Implement a robust overflows_type() macro to test if a variable or > constant value would overflow another variable or type. This can be > used as a constant expression for static_assert() (whi

[Intel-gfx] [PATCH v4] overflow: Introduce overflows_type() and castable_to_type()

2022-10-21 Thread Gwan-gyeong Mun
From: Kees Cook Implement a robust overflows_type() macro to test if a variable or constant value would overflow another variable or type. This can be used as a constant expression for static_assert() (which requires a constant expression[1][2]) when used on constant values. This must be construc