Skip to content
Tcl Source Code History Of Ticket 70f3b23cad
Login

History Of Ticket 70f3b23cad

Artifacts Associated With Ticket 70f3b23cad

  1. Ticket change [062caa7aa8] (rid 235961) by oehhar on 2024-12-15 17:46:31:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The wiki page for extension migration [https://core.tcl-lang.org/tcl/wiki?name=Migrating+C+extensions+to+Tcl+9&p] contains:
      
      <verbatim>
      #ifdef USE_TCL_STUBS
          if (Tcl_InitStubs(interp, "8.5-", 0) == NULL)
      #else
          if (Tcl_PkgRequire(interp, "Tcl", "8.5-", 0) == NULL)
      #endif
          {
              return TCL_ERROR;
          }
      </verbatim>
      
      This might be wrong in two senses:
      
         *   The #ifdef is not required, as without defining USE_TCL_STUBS, "Tcl_InitStubs" works like "Tcl_PkgRequire"
        *   Following the Tcl_InitStubs documentation, the "-" charter is not allowed within the argument.
      
      Also, the sample extension is related here.
      
      Here is the TCL 8.6. description stating, that only numbers and dots are allowed:
      [https://core.tcl-lang.org/tcl/file?name=doc/InitStubs.3&ci=84c07aaa29698bb8&ln=23-24]
      IMHO, the "PackageRequire" capability without "USE_TCL_STUBS" is also undocumented.
      
      Here is the 9.0 (main) description which is identical:
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=on&ci=tip&name=doc%2FInitStubs.3]
      
    5. foundin initialized to: "8.6 - 9.0"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "70. Sample Extension"
    15. title initialized to:
      Tcl_InitStubs: is the "-" in the version requirement "8.5-" allowed?
      
    16. type initialized to: "Bug"
  2. Ticket change [ad54581286] (rid 235962) by oehhar on 2024-12-15 17:47:28:

    1. comment changed to:
      The wiki page for extension migration [https://core.tcl-lang.org/tcl/wiki?name=Migrating+C+extensions+to+Tcl+9&p] contains:
      
      <verbatim>
      #ifdef USE_TCL_STUBS
          if (Tcl_InitStubs(interp, "8.5-", 0) == NULL)
      #else
          if (Tcl_PkgRequire(interp, "Tcl", "8.5-", 0) == NULL)
      #endif
          {
              return TCL_ERROR;
          }
      </verbatim>
      
      This might be wrong in two senses:
      
         *   The #ifdef is not required, as without defining USE_TCL_STUBS, "Tcl_InitStubs" works like "Tcl_PkgRequire"
        *   Following the Tcl_InitStubs documentation, the "-" charter is not allowed within the argument.
      
      Also, the sample extension is related here.
      
      Here is the TCL 8.6. description stating, that only numbers and dots are allowed:
      [https://core.tcl-lang.org/tcl/file?name=doc/InitStubs.3&ci=84c07aaa29698bb8&ln=23-24]
      IMHO, the "PackageRequire" capability without "USE_TCL_STUBS" is also undocumented.
      
      Here is the 9.0 (main) description which is identical:
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=on&ci=tip&name=doc%2FInitStubs.3]
      
      THanks to Francois to point-out this issue.
      
    2. login: "oehhar"
    3. mimetype: "text/plain"
  3. Ticket change [197652ac66] (rid 235965) by oehhar on 2024-12-15 17:58:58:

    1. comment changed to:
      The wiki page for extension migration [https://core.tcl-lang.org/tcl/wiki?name=Migrating+C+extensions+to+Tcl+9&p] contains:
      
      <verbatim>
      #ifdef USE_TCL_STUBS
          if (Tcl_InitStubs(interp, "8.5-", 0) == NULL)
      #else
          if (Tcl_PkgRequire(interp, "Tcl", "8.5-", 0) == NULL)
      #endif
          {
              return TCL_ERROR;
          }
      </verbatim>
      
      This might be wrong in two senses:
      
         *   The #ifdef is not required, as without defining USE_TCL_STUBS, "Tcl_InitStubs" works like "Tcl_PkgRequire"
        *   Following the Tcl_InitStubs documentation, the "-" character is not allowed within the argument.
      
      Also, the sample extension is related here.
      
      Here is the TCL 8.6. description stating, that only numbers and dots are allowed:
      [https://core.tcl-lang.org/tcl/file?name=doc/InitStubs.3&ci=84c07aaa29698bb8&ln=23-24]
      IMHO, the "PackageRequire" capability without "USE_TCL_STUBS" is also undocumented.
      
      Here is the 9.0 (main) description which is identical:
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=on&ci=tip&name=doc%2FInitStubs.3]
      
      THanks to Francois to point-out this issue.
      
    2. login: "oehhar"
    3. mimetype: "text/plain"
  4. Ticket change [5f58a6f2ac] (rid 235966) by fvogel on 2024-12-15 18:28:09:

    1. icomment:
      Regarding the dash "-" char: from a very quick look at the code it seems the actual version is obtained through tcl_PkgRequireEx, which *I think* calls Tcl_PkgRequireEx, which allows version numbers as documented for package require. So I think that it's probably the documentation that should be improved. But don't take this as certain since I didn't check sufficiently in depth.
      
    2. login: "fvogel"
    3. mimetype: "text/plain"
  5. Ticket change [49ca7bb96f] (rid 235970) by jan.nijtmans on 2024-12-15 22:11:25:

    1. icomment:
      The enhanced "package" syntax is described in [https://core.tcl-lang.org/tips/doc/trunk/tip/268.md|TIP #268], and is available since Tcl 8.5.
      
      Apparently, "InitStubs.3" was never adapted to describe the enhanced TIP #268 syntax.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [9961591c04] (rid 235993) by oehhar on 2024-12-16 11:51:45:

    1. icomment:
      Propose new wording for the documentation with checkin [607aea587f] of branch [70f3b23cad-docs-version-requirement].
      
      Comments welcome !
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  7. Ticket change [c6b87da8fd] (rid 236045) by oehhar on 2024-12-20 10:21:18:

    1. icomment:
      Possible merge is postponed after 9.0.1 release.
      
      Thanks for all,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  8. Ticket change [5cc9296f87] (rid 236397) by jan.nijtmans on 2025-01-03 14:52:12:

    1. icomment:
      Looks good to me. Just one minor remark and an addition:
      [90436ee9e3ff3b1f]
      
      +1 for merge to trunk and 8.7
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [98c9f9e505] (rid 236442) by oehhar on 2025-01-06 18:21:28:

    1. icomment:
      Thanks, Jan, for looking into this.
      Jan, we need your light here.
      
      The last meeting revealed other issues:
      
         *   an application will probably crash, if another version is used than the compiled one (e.g. 8.6 or 9.0).
         *   Ashok proposed to use "TCL_VERSION" as content.
         *   The magic functionality will probable work to make a binary work for 8.7 and 9.0. But 8.7 is not released, so this is a future feature.
         *   The strict flag is overladed by macros to hold other information. But this is not packward compatible and not tipped. So this documentation correction would manifest it.
         *   The macro stuff is not tipped neither.
      
      Sorry, but this may be subject of the next telco.
      So, we get Jans light....
      
      Take care,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  10. Ticket change [4a9572239c] (rid 236447) by jan.nijtmans on 2025-01-06 21:24:28:

    1. icomment:
      > Ashok proposed to use "TCL_VERSION" as content
      
      This is a bad idea. I created a [09218bf9618b1c29|demo] why. (try this with Linux or gcc on Windows)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  11. Ticket change [c2982775a7] (rid 236448) by oehhar on 2025-01-06 21:27:53:

    1. icomment:
      Thanks, Jan !
      Nor Don, nor Ashok have any clue what to put into the version field.
      So, your light is really required.
      
      Thanks,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  12. Ticket change [09f4fe2d03] (rid 236452) by jan.nijtmans on 2025-01-06 22:19:08:

    1. icomment:
      In most cases "8.6" is the right answer. After conversion to work with 9.0, "8.6-" or "8.6-10" is the right answer. Who is still interested in 8.5? And 8.7 doesn't exist yet.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [baddd29b75] (rid 236457) by apnadkarni on 2025-01-07 03:05:10:

    1. icomment:
      To clarify, what I was trying to say is that I saw no use for the version parameter. In my view the argument passed to `Tcl_InitStubs` should always be `TCL_VERSION` and never a hardcoded "8.6" or similar. And this has nothing to do with Tcl 8 vs 9. It ensures that any attempt to load an extension into a version of Tcl older than the one against which it is built will fail.
      
      For example, the extension might say `Tcl_InitStubs(..., "8.5",...)` but then be built against Tcl 8.6. That binary built against 8.6 should not be loadable into 8.5. No matter the programmer's claim that it only uses 8.5 stubs functions. Even if that was the case when initially written, over time as the extension evolves, 8.6 stubs might be called. The whole purpose is to protect against inadvertent programmer errors and hardcoding "8.5" defeats that purpose.
      
      Put it differently, the `Tcl_InitStubs` call should not have had a version parameter at all. It should have just used `TCL_VERSION` in it's internal checks. It's too late to change now, but the advice should be to always just pass `TCL_VERSION` to the function.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  14. Ticket change [eae9891ce0] (rid 236458) by fvogel on 2025-01-07 06:47:12:

    1. icomment:
      One point regarding Jan's attempt to clarify even more in the man pages in [3200a10430]: The comments following each line of code must be correct as of now only. As time passes and more Tcl version come out we will have to remember to update these comments. That's why I'm not 100% comfortable with this commit. I would see a pointer to the [https://core.tcl-lang.org/tcl/artifact/e6e5aeb810?ln=302.352|"VERSION NUMBERS"] section and to the [https://core.tcl-lang.org/tcl/artifact/e6e5aeb810?ln=203,263|package vatisfies] section of the [package] man page as a better alternative since those are much less specific.
      
    2. login: "fvogel"
    3. mimetype: "text/x-fossil-wiki"
  15. Ticket change [7169a15925] (rid 236798) by jan.nijtmans on 2025-01-10 14:06:42:

    1. icomment:
      Another [7512a6295d64bab9|attempt] to make things more clear without too much bloat.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  16. Ticket change [48abc4dccc] (rid 236802) by fvogel on 2025-01-10 19:57:38:

    1. icomment: "Nice, thanks!"
    2. login: "fvogel"
    3. mimetype: "text/plain"
  17. Ticket change [8a594be2b6] (rid 236844) by jan.nijtmans on 2025-01-12 18:15:04:

    1. closedate changed to: "2460688.2604711"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Merged to [5d7aa913b0164aec|trunk] and other branches.
      
      Since this is a doc-fix only, no need to mention this in changes.md
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  18. Ticket change [d892e9b835] (rid 236845) by oehhar on 2025-01-13 07:25:15:

    1. closedate changed to: "2460688.8092099"
    2. closer changed to: "oehhar"
    3. icomment:
      Thanks, great.
      
      The new text mentions "8.6", "8.6-", but not "8.6-9".
      
      Would it be a good idea also to add the 3rd form "8.6-9" ?
      
      Thanks,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/plain"
    6. username: "oehhar"
  19. Ticket change [9369d94098] (rid 236848) by jan.nijtmans on 2025-01-13 08:35:04:

    1. closedate changed to: "2460688.85768559"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      > Would it be a good idea also to add the 3rd form "8.6-9" ?
      
      No, because "8.6-9" is exactly the same as "8.6", I see no added value.
      
      What you probably mean is "8.6-10" (because the max-value is _exclusive_, remember ....), Which means that all between 8.6 (inclusive) and 10.0 (exclusive) works.
      
      It's exactly this risk, people forgetting that the end-value is _exclusive_  why I prefer "8.6-" more than "8.6-10". Whether Tcl 10.0 will work or not, is not a concern yet, I don't think we will see Tcl 10.0 before my pension.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
  20. Ticket change [b1874f9610] (rid 236849) by oehhar on 2025-01-13 09:11:22:

    1. closedate changed to: "2460688.8828967"
    2. closer changed to: "oehhar"
    3. icomment:
      Ok, thanks, great work.
      I was trapped by my own trap ;-).
      
      The change of the strict parameter from boolean to "list of flags" should be mentioned in the release notes.
      
      Remark that at least in machine language, a boolean 1 is always "-1" (all bits set) and not "1" (only LSB set).
      
      Thank you and take care,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/plain"
    6. username: "oehhar"
  21. Ticket change [2781e9247d] (rid 236852) by jan.nijtmans on 2025-01-13 09:56:43:

    1. closedate changed to: "2460688.91439444"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      I have no objection, mentioning this in the release notes.
      
      I don't know anyone calling Tcl_InitStubs(.... , 1). We should recommend the 'exact' parameter to be _0_ always. There's no use-case for making it _1_ (or _-1_, if you like).
      
      In C, printing a boolean always gives '1' or '0', never '-1'.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-markdown"
  22. Ticket change [1761c14c8b] (rid 237332) by oehhar on 2025-01-30 13:15:26:

    1. closedate changed to: "2460706.05238684"
    2. closer changed to: "oehhar"
    3. icomment:
      Mnetioned in the Migration wiki page of TCL by [efbd9d4fb4] and Tk by [https://core.tcl-lang.org/tk/info/2775ca08f78b27ab].
      
      I think, this is the best place for this information.
      
      Thanks,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/x-fossil-wiki"
    6. username: "oehhar"