Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fc547480b409f4ccbdc2f4665d4651268d1ee113
Ticket: 845155ffffffffffffffffffffffffffffffffff
Check ANSI C switches
User & Date: elfring on 2003-11-19 14:32:40
Changes

  1. assignee changed to: "mdejong"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I see that the macro "_ANSI_ARGS_" is used for definitions of function pointers. (File "generic/tcl.h")
    But I am missing a macro to switch between old style function signature and current ANSI conformance.
    
    File "generic/tclAlloc.c":
    ...
    char *
    TclpAlloc(nbytes)
        unsigned int nbytes;/* Number of bytes to allocate. */
    { ...
    
    I would prefer this definition.
    ...
    void* TclpAlloc(unsigned int nbytes   /* Number of bytes to allocate. */)
     { ...
    
    #if defined(__STDC__) || defined(__cplusplus)
    #   undef NO_PROTOTYPES
    #   define FUNCTION_PARMETER_DELIMITER ,
    #   define FUNCTION_HEAD(specifiers, name, parameters) specifiers name (parameters)
    #else
    #   define FUNCTION_PARMETER_DELIMITER ;
    #   define FUNCTION_HEAD(specifiers, name, parameters) specifiers name () parameters
    #endif
    
    #define FUNCTION_PARMETER_JOIN(x, y) x##FUNCTION_PARMETER_DELIMITER y##FUNCTION_PARMETER_DELIMITER
    
    
    => Example:
    FUNCTION_HEAD(EXTERN void*, TclpRealloc, FUNCTION_PARMETER_JOIN(char *cp, unsigned int nbytes))
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "elfring"
  9. subsystem changed to: "52. Portability Support"
  10. title changed to: "Check ANSI C switches"
  11. type changed to: "RFE"