#3888 TclCompile uses C++ reserved keyword "operator"

obsolete: 8.5.0
closed-fixed
8
2008-01-17
2007-12-21
No

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.

Discussion

  • Donal K. Fellows

    • priority: 5 --> 3
     
  • Donal K. Fellows

    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.)

     
  • miguel sofer

    miguel sofer - 2007-12-21

    Logged In: YES
    user_id=148712
    Originator: NO

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

     
  • miguel sofer

    miguel sofer - 2008-01-04
    • priority: 3 --> 8
     
  • miguel sofer

    miguel sofer - 2008-01-11
     
  • miguel sofer

    miguel sofer - 2008-01-11

    Logged In: YES
    user_id=148712
    Originator: NO

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

     
  • miguel sofer

    miguel sofer - 2008-01-11
    • assigned_to: msofer --> dgp
     
  • Don Porter

    Don Porter - 2008-01-15

    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.

     
  • Don Porter

    Don Porter - 2008-01-15
    • assigned_to: dgp --> msofer
     
  • miguel sofer

    miguel sofer - 2008-01-17
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks