Ticket Change Details
Not logged in
Overview

Artifact ID: aa53f237bb9320461d4b9b9b6c4da33425a7fde7919c5dea36cdce35964e3ecd
Ticket: 9c258a841a03860f24e52283b650c7823da2e8e6
format - undocumented type specifiers + possible bugs
User & Date: apnadkarni 2024-05-28 15:56:39
Changes

  1. icomment:
    Based on the output below, I think j, t, z are not what I would expect as per their C printf definition (assuming that is the goal). They should truncate values that do not fit in intmax_t, ptrdiff_t, size_t to the appropriate size (32 or 64-bit depending on architecture). I would certainly find that useful in FFI type extensions.
    
    ```
    % set int64 0x8000000000000001
    0x8000000000000001
    % set int65 0x10000000000000000
    0x10000000000000000
    % foreach t {d u} {foreach s {{} j l ll t z I I32 I64} {puts "$s$t\t[format %$s$t $::int64] [format %$s$t $::int65]"}}
    d       1 0
    jd      9223372036854775809 18446744073709551616
    ld      -9223372036854775807 0
    lld     9223372036854775809 18446744073709551616
    td      9223372036854775809 18446744073709551616
    zd      9223372036854775809 18446744073709551616
    Id      1 0
    I32d    1 0
    I64d    -9223372036854775807 0
    u       1 0
    ju      9223372036854775809 18446744073709551616
    lu      9223372036854775809 0
    llu     9223372036854775809 18446744073709551616
    tu      9223372036854775809 18446744073709551616
    zu      9223372036854775809 18446744073709551616
    Iu      1 0
    I32u    1 0
    I64u    9223372036854775809 0
    ```
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"