C23 removed the whole stuff about indeterminate value and trap representation. Underflow/overflow being silent or not is implementation defined.
int a[2];
a[-1]; // not ok
(&a[0])[-1] // ok
C23: https://cstd.eisie.net/c2y.html#6.5.3.2 void foo( int (*f)() )
{
f(1);
f(1, "2" , 3.0);
}
https://godbolt.org/z/s6e5rnqv9 unsigned int popcount(unsigned int n)
{
return (n &= n - 1u) ? (1u + popcount(n)) : 0u;
}
Clang 21.1 x64: popcount:
mov eax, -1
.LBB0_1:
lea ecx, [rdi - 1]
inc eax
and ecx, edi
mov edi, ecx
jne .LBB0_1
ret
GCC 15.2: popcount:
blsr edi, edi
popcnt eax, edi
ret
Both compiled with -O3 -march=znver5