On Tue, Mar 20, 2018 at 06:45:08PM +0500, ???? ??????? wrote: > "UB" stands for undefined behaviour. that's the reason why cppcheck is > unhappy. > how do that properly - that's the question :)
The thing is that I'm not aware of any other way to safely detect integer overflows, it's always done like this. In fact this undefined behaviour on unsigned ints is defined per-architecture. I think you can safely turn this one off as we do use integer wrapping at other places on purpose, and we even build with -fwrapv to make it defined :-) Cheers, Willy

