Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-11-16
06:44 • Closed ticket [842511ffff]: compilation errors in tclParse.c, tclTest.c plus... artifact: e18de9e72b user: dkf
2003-11-15
10:18 • Ticket [842511ffff]: 6 changes artifact: ec2c4c5cd4 user: dgp
07:47 • Ticket [842511ffff]: 1 change artifact: afe8095464 user: vincentdarley
00:28 • New ticket [842511ffff]. artifact: 06e6c8947c user: vincentdarley

compilation errors in tclParse.c, tclTest.c

Closed / Fixed842511ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-11-15 00:28:41
Line 354 of tclParse.c gives me an 'signed/unsigned ==
comparison error' when compiling on Windows VC++ 5.2. 
This change fixes the problem:

    if ( (expPfxLen == (size_t)expPtr->size)

(i.e. add a cast to 'size_t').

Similarly tclTest.c, line 6469 vs 6481 have a problem.
6469 in const, but the third parameter of
Tcl_InitCustomHashTable is not const:

    static const Tcl_HashKeyType hkType = {
TCL_HASH_KEY_TYPE_VERSION, TCL_HASH_KEY_SYSTEM_HASH,
NULL, NULL, NULL, NULL
    };
    Tcl_HashTable hash;
    Tcl_HashEntry *hPtr;
    int i, isNew, limit = 100;

    if (objc>1 && Tcl_GetIntFromObj(interp, objv[1],
&limit)!=TCL_OK) {
return TCL_ERROR;
    }

    Tcl_InitCustomHashTable(&hash,
TCL_CUSTOM_TYPE_KEYS, &hkType);

removing 'const' fixes the problem, but it may be
better to change the definition of
Tcl_InitCustomHashTable to add CONST, for all I know.

I thought Tcl used capital letters for 'const' anyway,
as a separate matter....
vincentdarley Ticket [842511ffff]: 1 change [History diff]2003-11-15 07:47:45
dgpplain2003-11-15 10:18:27
Logged In: YES 
user_id=80530


Thanks for the testing.
Fix for tclParse.x accepted.

Passing on to dkf for the
new hash table testing issue.
dkfplain2003-11-16 06:44:26
Logged In: YES 
user_id=79902

Removed the const.

I'm not 100% happy with it, but this is not the only public
API in the core with this problem (e.g. Tcl_RegisterObjType)
and I don't feel like embarking on a crusade to clean them
all up.
Log in (anonymous is fine) to add a comment.