4 ms·
Time is not guaranteed to be signed. W Hat you have there is undefined behaviour.
by bregma 4y ago
Time is not guaranteed to be signed. W Hat you have there is undefined behaviour.
- fluoridation 4y agoSurely it's unspecified behavior, at worst.
- bregma 4y agoThe signedness of time_t is unspecified. If you rely on it being signed and overflowing so it goes back to before January 01, 1970, well, that's living on the edge....
- fluoridation 4y agoOnly if your code is intended to be portable. If you know the signedness of time_t in your implementation, there's no harm in assuming it.
- Karellen 4y agoIt's probably more likely to be implementation-defined behaviour (as with the signedness of 'char') rather than undefined behaviour. The third alternative being unspecified behaviour - see comp.lang.c FAQ 11.33 for more info: https://c-faq.com/ansi/undef.html https://c-faq.com/ansi/undef.html