Skip to content
Tcl Source Code History Of Ticket da6f155ca4
Login

History Of Ticket da6f155ca4

Artifacts Associated With Ticket da6f155ca4

  1. Ticket change [0969894470] (rid 196922) by chrstphrchvz on 2021-12-24 19:19:54:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      I don’t observe anything broken due to the lack of parentheses around <tt>numChars</tt> in the <tt>STRING_SIZE()</tt> macro, but would it be a good idea to parenthesize it anyway to avoid surprises?
      
      <pre>
      diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h
      index 25b854ea4..59e9499a7 100644
      --- a/generic/tclStringRep.h
      +++ b/generic/tclStringRep.h
      @@ -67,7 +67,7 @@ typedef struct String {
       #define STRING_MAXCHARS \
           (int)(((size_t)UINT_MAX - 1 - TclOffset(String, unicode))/sizeof(Tcl_UniChar))
       #define STRING_SIZE(numChars) \
      <span style="color:red">-    (TclOffset(String, unicode) + ((numChars + 1) * sizeof(Tcl_UniChar)))</span>
      <span style="color:green">+    (TclOffset(String, unicode) + (((numChars) + 1) * sizeof(Tcl_UniChar)))</span>
       #define stringCheckLimits(numChars) \
           do {								\
       	if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) {		\
      </pre>
      
    5. foundin initialized to: "8.6.12"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Cosmetic"
    11. status initialized to: "Open"
    12. submitter initialized to: "chrstphrchvz"
    13. subsystem initialized to: "10. Objects"
    14. title initialized to: "STRING_SIZE() macro: parenthesize numChars usage"
    15. type initialized to: "Patch"
  2. Ticket change [044b2a74da] (rid 197024) by jan.nijtmans on 2022-01-12 21:15:59:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459592.38610872"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Fixed [2bb7cd72c8c5f5a3|here]. Thanks for the report and the patch. This same commit fixes other similar macro's too.
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"