Skip to content
Tcl Source Code History Of Ticket 8fb059e8ec
Login

History Of Ticket 8fb059e8ec

Artifacts Associated With Ticket 8fb059e8ec

  1. Ticket change [dd35a93d40] (rid 225290) by dgp on 2024-04-24 16:12:36:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Recent check-in [c6d3960498] included a large number of changes where
      a sentinel argument was changed from
      
        (void) NULL
      
      to
      
        (char *) NULL
      
      Would we get code maintenance benefit from a macro in a header file:
      
      #define TCL_SENTINEL (char *) NULL
      
      so we can make any similar future modifications in one place?
      
    5. is_private initialized to: "0"
    6. login: "dgp"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "8e2300e85be5dd1445b9666eb9429055951e33be"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "None"
    14. title initialized to: "macro for sentinels"
    15. type initialized to: "RFE"
  2. Ticket change [724487369b] (rid 225321) by jan.nijtmans on 2024-04-25 09:55:03:

    1. icomment:
      Actually, it was changed from (void *)NULL to (char *)NULL. The reason for this is just readability: It is used in functions like Tcl_SetErrorCode(), Tcl_AppendResult(), and Tcl_AppendStringsToObj(), which expect strings in all its elements. Using (char *)NULL makes it immediately clear that the last sentinel argument is a string too.
      
      Using TCL_SENTINEL would hide that information, I don't think we want that. In functions like mp_init_multi() sentinels are used as well, but there the arguments are not strings. Therefore (void *)NULL is kept there: It could have been changed to (mp_int *)NULL, but that looks more ugly.
      
      Just my 2c
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [91d2337634] (rid 225322) by chw on 2024-04-25 10:24:13:

    1. icomment:
      Can't resist to throw my 2 cents into this debate.
      Few months ago we had a similar discussion about the cons and pros
      of TCL_UNUSED and my argument against it was information loss.
      Now, the use of TCL_SENTINEL is information loss, too, and arguably
      not favorable?
      Am I the only one who's somewhat puzzled?
      
    2. login: "chw"
    3. mimetype: "text/x-fossil-plain"
  4. Ticket change [2180f6540b] (rid 225323) by jan.nijtmans on 2024-04-25 11:06:24:

    1. icomment:
      lol. So you would prefer `TCL_SENTINEL(char *)` then ??
      
      The difference with TCL_UNUSED is that C/C++ already has the standard construct `(type)NULL` for exactly what we want here.
      
      That 2 more cents, making 6 ;-)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [765d922da8] (rid 225324) by chw on 2024-04-25 11:47:27:

    1. icomment:
      Lemme be clear, neither do I like TCL_UNUSED, nor TCL_SENTINEL.
      Both hide in my irrelevant opinion information. But if that is
      culturally common sense, so be it and I need to get used to it
      and finally have to live with it.
      
    2. login: "chw"
    3. mimetype: "text/x-fossil-plain"
  6. Ticket change [43ab95ceda] (rid 225325) by sebres on 2024-04-25 11:58:22:

    1. icomment:
      Is it really necessary to switch cast from `(char *)NULL` to `(void *)NULL`?<br/>
      I mean isn't `void *` compatible with `(char *)NULL`? And from point of view the functions with variadic args like Tcl_AppendResult it is also the same thing.<br/>
      So let it be `(char *)NULL` everywhere - no changes across versions, no conflicts, no special sentinel macro needed...
      
    2. login: "sebres"
    3. mimetype: "text/x-markdown"
  7. Ticket change [371c2927d7] (rid 225326) by jan.nijtmans on 2024-04-25 12:05:09:

    1. icomment:
      > So let it be (char *)NULL everywhere - no changes across versions, no conflicts, no special sentinel macro needed...
      
      Yes, that's the idea....
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [c22148638a] (rid 261551) by serhiy.storchaka on 2026-11-13 11:18:45:

    1. closedate changed to: "2461357.9713335303"
    2. closer changed to: "serhiy.storchaka"
    3. icomment:
      Closing: the consensus above was to keep the explicit (char *)NULL sentinels.
      
    4. login: "serhiy.storchaka"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"