>> 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

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to