Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 89e2caa77782bd09387353cf0facd0146ad04f83ca6adbe48dd97866641cf721
Ticket: d40b9c8503eb4deeaeb01352b2d0937f77624e49
Enforcing 64-bit time_t?
User & Date: chrstphrchvz on 2023-03-24 13:31:00
Changes

  1. comment changed to:
    To what extent does/should Tcl 9.0 assume/require/enforce 64-bit <tt>time_t</tt>?
    
    Currently, when I build Tcl 9.0 on ia32 (32-bit x86) Linux, it uses 32-bit <tt>time_t</tt>, but the tests cmdAH-24.20.1 and cmdAH-24.20.2 fail (rather than skip as with 8.7; timestamp 3155760000 overflows to -1139207296). I can also reproduce the issue in [fa128568a597]. (Maybe the same would happen for 32-bit ARM.)
    
    I read elsewhere that glibc 2.34 and Linux kernel 5.6 support 64-bit <tt>time_t</tt> on 32-bit systems by compiling with <tt>_FILE_OFFSET_SIZE=64</tt> and <tt>_TIME_BITS=64</tt> defined, and that future glibc may even define these by default. I tried building Tcl 9.0 again with these defined, and confirmed that doing so avoids the overflow issues. This approach reportedly supersedes<s>/conflicts</s> with the approach of defining <tt>_LARGEFILE64_SOURCE</tt>, as <s>proposed</s> removed in the bug-02b58d5d04 branch. Would it be appropriate for Tcl/Tk to instead define <tt>_FILE_OFFSET_SIZE=64</tt> and <tt>_TIME_BITS=64</tt> by default (possibly before package managers all begin separately trying to do so themselves)?
    
  2. icomment:
    I believe I misunderstood the purpose of the bug-02b58d5d04 branch, and that the proposal in this ticket would actually complement the work in it: <tt>_FILE_OFFSET_BITS=64</tt> affects the functions exposed by <tt>_LARGEFILE_SOURCE</tt>, as an alternative to using functions exposed by <tt>_LARGEFILE64_SOURCE</tt> which that branch removes usage of. Can that branch please be updated from the current main branch?
    
  3. login: "chrstphrchvz"
  4. mimetype: "text/x-fossil-wiki"