Tcl Source Code

View Ticket
Login
Ticket UUID: 732477
Title: Please do not use "id" as a dummy variable in functions
Type: Bug Created on: 2003-05-05 04:08:08
Submitter: pauljohn32 Assigned to: mistachkin
Subsystem: 49. Threading Severity:
Priority: 3 Low Last modified: 2003-05-13 17:27:49
Status: Closed Closed by: mistachkin
Resolution: Fixed Closed on: 2003-05-13 10:27:49
Version: obsolete: 8.4.2
Description:
In the upgrade from tcl/tk 8.3 to 8.4, I started to
encounter trouble compiling programs in Objective-C
that are linked with tcl/tk.  We can't compile the
Swarm library (www.swarm.org) against 8.4 because "id"
is used as a variable name.  The problem is that
Objective-C uses a reserved word "id" to refer to an
object.  

The problems are in tclDecls.h

EXTERN intTcl_JoinThread _ANSI_ARGS_((Tcl_ThreadId
id,  int* result));

I notice in some of your other functions you have
threadId where this one has "id".

As it stands, in order to compile Swarm, I have to
comment out Tcl_JoinThread from tclDecls.h
User Comments:
mistachkin added on 2003-05-13 09:14:06:
Logged In: YES 
user_id=113501

According to the ANSI standard, compilers are not 
supposed to reserve identifiers that do NOT start with 
an underscore or double underscore.

Does anybody know if we support compilation using 
Objective-C?

pauljohn32 added on 2003-05-13 12:06:23:
Logged In: YES 
user_id=23726

Hello.  My understanding has been that in C one cannot have
dummy variables named "int", "double", "float", etc.  It
won't allow a function like

int aFunct (int double);

or some such thing, right?

In Objective-C, "id' is like "double".  The problem would go
away if you just changed "id" to "threadID" in that one method.

patthoyts added on 2003-05-13 16:19:05:
Logged In: YES 
user_id=202636

Bear in mind that this only requires changing in the public
header. In fact you could simply delete the word 'id' and
leave the bare signature. One wouldn't compile tcl itself
with objective-c but should be able to create extensions
using this compiler. 

It certainly used to work (some time ago).