Я уже писал, что
занимаюсь проблемой 2038-го года. В сязи с этим вспомнил и узнал несколько забавных фактов.
Угадайте:
- Каков диапазон целочисленных значений, который может принимать переменная типа time_t?
- Какое значение возвращает функция mktime для идентификации ошибки?
- Какое значение вернёт функция mktime, если передать ей отрицательный день или 14
( Read more... )
Comments 4
Reply
(The comment has been removed)
"There was originally some controversy over whether the Unix time_t should be signed or unsigned. If unsigned, its range in the future would be doubled, postponing the 32-bit overflow (by 68 years). However, it would then be incapable of representing times prior to 1970. Dennis Ritchie, when asked about this issue, said that he hadn't thought very deeply about it, but was of the opinion that the ability to represent all times within his lifetime would be nice. (Ritchie's birth time is around Unix time -893,400,000.) The consensus, and universal practice, is for time_t to be signed."
Reply
Reply
Reply
Leave a comment