Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5ca5745fb425e42463bebe70247d000e7b06d7d8
Ticket: 2124814fffffffffffffffffffffffffffffffff
Compilation of tclOOMethod.c fails for MSVC 6.0 compiler
User & Date: flatworm on 2008-09-23 16:00:45
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Compilation of tclOOMethod.c fails for MSVC 6.0 compiler with this error:
    
    tclOOMethod.c ..\generic\tclOOMethod.c(24) : error C2010: '.' : unexpected in macro formal parameter list
    ..\generic\tclOOMethod.c(24) : error C2010: '.' : unexpected in macro formal parameter list
    ..\generic\tclOOMethod.c(24) : error C2010: '.' : unexpected in macro formal parameter list
    ..\generic\tclOOMethod.c(24) : error C2010: ')' : unexpected in macro formal parameter list
    
    The culprit is the debugging code:
    
    #if 0
    #define DBPRINT(format, ...) (fprintf(stderr, "DEBUG:" format "\n", __VA_ARGS__))
    #else
    #define DBPRINT(format, ...) ((void) 0)
    #endif
    
    This particular compiler seem to doesn't understand "..." in macro definitions, and I'm sure if it's not gcc'ism, it can be at least C99'ism or so.
    
    Changing 
    #define DBPRINT(format, ...) ((void) 0)
    to
    #define DBPRINT(format, X) ((void) 0)
    solved the problem.
    
    I would propose using the "standard" technique:
    if 0
    #define DBPRINT(X) printf##X
    #else
    #define DBPRINT(X) do {} while(0)
    #endif
    ...
    DBPRINTF(("foo is %d\n", Foo));
    
    
  4. foundin changed to: "obsolete: 8.6a3"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "flatworm"
  10. subsystem changed to: "35. TclOO Package"
  11. title changed to:
    Compilation of tclOOMethod.c fails for MSVC 6.0 compiler
    
  12. type changed to: "Bug"