TIP 752 broke [clock seconds] in 32bit linux
Closed / Fixedd5acb07b64119b040bfa8d8eadb445d4e6b73747Created 123 days agoUpdated 115 days ago
Descriptionmarkdown2026-08-02 16:43:24
After merge of TIP 752, running 32bit linux
$ uname -m
i686
$ tclsh9.1
% clock seconds
203
The problem is an int overflow in Tcl_GetDayTime(). Attached patch fixes the issue and also shut ups a compiler warning
emiliano Ticket [d5acb07b64]: 4 changes
[History diff]2026-08-02 16:45:08
jan.nijtmanswiki2026-08-02 19:52:24
+1
Just go ahead!
jan.nijtmanswiki2026-08-10 10:03:52
Fixed [here]
However .... Tcl 9.x is supposed to be compiled with -D_TIME_BITS=64 (and -D_FILE_OFFSET_BITS=64), which makes time_t a 64-bit type. Then this 'bug' doesn't occur. Apparently, you are using an older (pre-5.1) linux kernel, which doesn't 64-bit time. This means that your Tcl build on linux is not Y2038-safe. It would be better to upgrade your environment somewhere in the next 12 years!
Log in (anonymous is fine) to add a comment.
Attachments:
- clockseconds.diff [download] added by emiliano on 2026-08-02 16:44:35. [details]