>> Should this be reported to the clang folks? Or is this to be expected when abusing integer overflows this way? > > You will get an answer that this is expected. Add -fwrapv compiler flag > to make signed arithmetic behave in a way different from the mine-field, > or remove the code. For kernel, we use -fwrapv. Thanks, that was what I expected. I searched for -fwrapv and found similar comments. The code has been rewritten to not depend on overflow for its checks, so it works properly with any sized time_t (assuming that it is an integer though :). I'll commit it after feedback. Nick
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC