On Wed, Jul 30, 2025 at 06:15:56PM +0800, Yang Yujie wrote: > So wouldn't it be simpler if I just change the comparison in my patch into > a memcmp? This works regardless of how comparison is implemented. > (We all assume that expression (x) may have its address taken.)
No. memcmp after memcpy will be always identical. By treating the memcpy copied data as the promoted _BitInt (without knowing anything about it) and shifting right by S (x) for unsigned it needs to do the shift and the result will be 0 if correct and non-zero on error, similarly for signed shifting right by S (x) - 1 the result will be 0 or -1 if correct and otherwise erroneous. Jakub