https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102078
--- Comment #4 from David Binderman <dcb314 at hotmail dot com> --- Full cppcheck error message is gcc/ada/affinity.c:59:19: error: Signed integer overflow for expression '1<<index'. [integerOverflow] I think cppcheck is worried if index runs up to 64, i.e. when sizeof( unsigned) is 8, hence my suggestion. AFAIK, 1 << 31 loses the sign bit and so cppcheck likes to grumble, but I've long since forgotten if it is actually UB or not.