Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 96c93a50d36e07cee0c8d653c711bece3304900d37529c760a326a56d8d8dcfc
Ticket: 1e48483c8b3b2702b981ebcc85474512bb3d6e0d
Use of non-standard C code in TCLBOOLWARNING
User & Date: gustafn3 on 2024-04-26 12:07:39
Changes

  1. icomment:
    > does this work for you
    
    ... mostly, parentheses should be added
    
    tclsock.c:1333:22: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
                result = Tcl_GetBooleanFromObj(interp, objPtr, &ok);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/ns9/include/tclDecls.h:4057:90: note: expanded from macro 'Tcl_GetBooleanFromObj'
            (TCLBOOLWARNING(boolPtr)(sizeof(*(boolPtr)) >= sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    tclsock.c:1333:22: note: place parentheses around the '+' expression to silence this warning
                result = Tcl_GetBooleanFromObj(interp, objPtr, &ok);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/ns9/include/tclDecls.h:4057:90: note: expanded from macro 'Tcl_GetBooleanFromObj'
            (TCLBOOLWARNING(boolPtr)(sizeof(*(boolPtr)) >= sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    tclsock.c:1333:22: note: place parentheses around the '?:' expression to evaluate it first
                result = Tcl_GetBooleanFromObj(interp, objPtr, &ok);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/ns9/include/tclDecls.h:4057:90: note: expanded from macro 'Tcl_GetBooleanFromObj'
            (TCLBOOLWARNING(boolPtr)(sizeof(*(boolPtr)) >= sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
    
  2. login: "gustafn3"
  3. mimetype: "text/plain"