Skip to content
Tcl Source Code History Of Ticket 482db1d796540e68
Login

History Of Ticket 482db1d796540e68

Artifacts Associated With Ticket 482db1d796540e68

  1. Ticket change [a8fab71537] (rid 238422) by sbron on 2025-03-11 14:25:38:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      I observe a wrong result from [clock add -631152000 2372806200 seconds]. This should obviously produce 1741654200 (-631152000 + 2372806200), but it returns 1741567800 instead.
      
    5. foundin initialized to: "2f1d68136a"
    6. is_private initialized to: "0"
    7. login: "sbron"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "8475f421649231f1e116ac602bea4537d2b027b4"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "sbron"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to:
      Wrong result from simple clock arithmetic (clock add).
      
    16. type initialized to: "Bug"
  2. Ticket change [d23721255d] (rid 238423) by sebres on 2025-03-11 17:41:13:

    1. foundin changed to: "8.7+"
    2. icomment:
      The reason is a bug by porting <i><code>[clock add]</code></i> from Tcl to C - calculating seconds of day <code><nobr>localSeconds % SECONDS_PER_DAY</nobr></code> on a negative base generates negative result in C (-82800 instead of 3600 as it'd be in Tcl), so after all the seconds of day are wrong and the whole result deviate by one day:
      <code><pre>
      <span style="color:red;">- UTC -631152000 => LOCTM -631148400 % 86400 == <b>-82800</b></span>  // C vs.
      <span style="color:green;">+ UTC -631152000 => LOCTM -631148400 % 86400 == <b>  3600</b></span>  ## Tcl
      </pre></code>
      Fixing it now for 8.7+, add coverage, etc...
      
    3. login: "sebres"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [97c0105030] (rid 238435) by sebres on 2025-03-11 18:45:47:

    1. closedate changed to: "2460746.28180307"
    2. closer changed to: "sebres"
    3. icomment:
      Basically fixed in [27cbd7afc65a5c79], but found more places for a compiler "fix" (signed-mod operation with potentially negative dividend), so added more corrections in [e33fcd57b0397d45] (including few code simplifications and normalizations).
      
      Test coverage is added too, so I close the ticket as fixed for now.
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  4. Ticket change [45ef10d1c0] (rid 238436) by sebres on 2025-03-11 19:07:40:

    1. closedate changed to: "2460746.29700208"
    2. login: "sebres"
    3. mimetype: "text/plain"
    4. title changed to:
      Wrong result from simple clock arithmetic (`clock add` with negative base).