Skip to content
Tcl Source Code View Ticket
Login

View Ticket

precision of errorCode CHILDSTATUS pid returnCode

Closed / Invalid218395ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:57:04
OriginalBugID: 5172 Bug
Version: 8.3
SubmitDate: '2000-04-19'
LastModified: '2000-04-20'
Severity: SER
Status: Closed
Submitter: techsupp
ChangedBy: ericm
OS: Windows NT
OSVersion: 4.0
Machine: Dell Optiplex GX1
FixedDate: '2000-10-25'
ClosedDate: '2000-04-20'


Name:
Christophe De Clercq

ReproducibleScript:
1) create any program that returns a value greather than 127 (7 bits)
2) on tcl prompt type: 
set myVar [catch {exec anyProg} myResult]
puts stdout $errorCode

ObservedBehavior:
if "anyProg.exe" returns the integer value of "200006"
the value of "errorCode" becomes => "CHILDSTATUS -1 70"

Possible explanation:
200006 is binary: 110000110101000110
    70 is binary:            1000110

It would mean that the precision is only 7 bit (unsigned integer?)
It tried to set the variable tcl_precision but this has no impact.

DesiredBehavior:
I expect the value of "errorCode" to be => "CHILDSTATUS -1 200006"

We use a lot of C programs that return "long integers" this would mean
a lot of recoding if only 7 bits are interpreted by TCL.



According to the MSDN:

    void exit ( int status );
    void _exit ( int status );

    ...

    Although the exit and _exit calls do not return a value, the
    low-order byte of status is made available to the waiting calling
    process, if one exists ...

This indicates that, as on UNIX, the return value from a program is
limited to the low-order 8 bytes of the value you give to exit.  This is
not a Tcl limitation.

- eric
 
-- 04/20/2000 ericm
welch Closed ticket [218395ffff]. [History diff]2000-10-26 08:21:17
dgp Ticket [218395ffff]: 4 changes [History diff]2001-04-20 02:02:07
Log in (anonymous is fine) to add a comment.