Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48488ed74fda205275ed7013a7b6e3fd93e15555
Ticket: 04e26c02c04596869907b5240ffa0c97457df352
Warning
User & Date: gahr on 2017-04-28 06:04:42
Changes

  1. closer changed to: "nobody"
  2. icomment:
    I fear this won't be enough: there is still an error case that isn't checked by the two expansions in TclCompareTwoNumbers. This function assumes that the objects are of some numeric type, so the value of the expression is just discarded and type is expected to be set after the expansion.
    
    
    generic/tclExecute.c:9242:12: warning: variable 'type1' is used uninitialized whenever '?:' condition is true
          [-Wsometimes-uninitialized]
        (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj'
        (((objPtr)->bytes != NULL) && ((objPtr)->length == 0))              \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    generic/tclExecute.c:9245:13: note: uninitialized use occurs here
        switch (type1) {
                ^~~~~
    generic/tclExecute.c:9242:12: note: remove the '?:' if its condition is always false
        (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
               ^
    generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj'
        (((objPtr)->bytes != NULL) && ((objPtr)->length == 0))              \
        ^
    generic/tclExecute.c:9233:14: note: initialize the variable 'type1' to silence this warning
        int type1, type2, compare;
                 ^
                  = 0
    1 warning generated.
    
  3. login: "gahr"
  4. mimetype: "text/plain"
  5. status changed to: "Open"
  6. username: "gahr"