Tcl Source Code

View Ticket
Login
Ticket UUID: 1855644
Title: TclCompile uses C++ reserved keyword "operator"
Type: Bug Version: obsolete: 8.5.0
Submitter: fanfdesalpes Created on: 2007-12-21 10:33:41
Subsystem: 47. Bytecode Compiler Assigned To: msofer
Priority: 8 Severity:
Status: Closed Last Modified: 2008-01-17 23:13:53
Resolution: Fixed Closed By: msofer
    Closed on: 2008-01-17 16:13:53
Description:
TclCompile uses C++ reserved keyword "operator" in the "TclOpCmdClientData" structure.

When compiling with C++, one has to

  #define operator _operator

before

  #include "tclCompile.h"

which is ugly.

I know I shouldn't include private headers such as this one, but using C++ reserved keywords should be avoided anyway, I think.
User Comments: dgp added on 2008-01-15 13:13:08:
Logged In: YES 
user_id=80530
Originator: NO


The tclUnixThrd.c change is in
the patch by mistake?

Other than that, this seems fine,
though catering to C++ needs is
mildly distasteful; especially
in a header file that no other
code is supposed to #include.

msofer added on 2008-01-11 20:46:21:

File Added - 261795: operator.diff

Logged In: YES 
user_id=148712
Originator: NO

Attached patch that replaxes 'operator' with 'op'. OK?
File Added: operator.diff

msofer added on 2007-12-22 04:56:46:
Logged In: YES 
user_id=148712
Originator: NO

It *is* in a header file: tclCompile.h, line 820

dkf added on 2007-12-22 04:22:53:
Logged In: YES 
user_id=79902
Originator: NO

We use other C++ reserved words all over too ("new" is a favourite). If it's not in a header file, I'm not going to get in the slightest bit excited. (The header files should be loadable even when compiling C++, of course.)

Attachments: