Tcl Source Code

Ticket Change Details
Login
Overview

Artifact ID: c372d923df6b6314a0475165edc9d3ef4873c5bf3d9a25439b081184fbaeb4d7
Ticket: b58e6897034fc5292c9d36ba8099d9a835c98172
Return value of `Tcl_Flush`
User & Date: dram 2017-10-19 10:55:18
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    It seems that return value description of `Tcl_Flush` in document[1] is not consistent with the implementation, it says result will be `TCL_OK` or `TCL_ERROR`, but sometimes `-1` is returned. e.g.:
    
    ```
    #include <tcl.h>
    
    
    int main()
    {
            Tcl_Interp *interp = Tcl_CreateInterp();
    
            Tcl_Channel channel = Tcl_GetStdChannel(TCL_STDIN);
    
            printf("TCL_OK = %d\n", TCL_OK);
            printf("TCL_ERROR = %d\n", TCL_ERROR);
            printf("Tcl_Flush(stdin) = %d\n", Tcl_Flush(channel));
    
            Tcl_DeleteInterp(interp);
    
            return 0;
    }
    ```
    
    Output:
    
    ```
    TCL_OK = 0
    TCL_ERROR = 1
    Tcl_Flush(stdin) = -1
    ```
    
    [1] https://tcl.tk/man/tcl8.6/TclLib/OpenFileChnl.htm#M19
    
  5. is_private changed to: "0"
  6. login: "dram"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "dram"
  12. subsystem changed to: "- New Builtin Commands"
  13. title changed to: "Return value of `Tcl_Flush`"
  14. type changed to: "Bug"