Skip to content
Tcl Source Code History Of Ticket 419692ffffffffff
Login

History Of Ticket 419692ffffffffff

Artifacts Associated With Ticket 419692ffffffffff

  1. Ticket change [1701e4cf98] (rid 124809) by nobody on 2001-04-28 03:52:54:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Regarding the inclusion of stdarg.h vs varargs.h in
      tcl.h.
      
      The ISO C++ standard, Section 16.8, says that whether
      __STDC__ is set, and the value it is set to, is
      implementation-defined.  I.e., it's useless for C++. 
      As a matter of fact, some C++ compilers (e.g. KAI's
      KCC) define it or not define it according to the custom 
      of the vendor's C++ compiler, since the vendor's
      headers expect likewise. 
      
      The proper fix is for the header file to adhere to the
      rules in Section 16.8, and use: 
      
      #if defined(__STDC__) || defined(HAS_STDARG) || \  
      defined(__cplusplus)
      #   include <stdarg.h>
      
      etc.  Alternately define HAS_STDARG if __cplusplus
      is defined.
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "52. Portability Support"
    10. title initialized to: "c++ & tcl.h inclusion of varargs.h"
    11. type initialized to: "Bug"
  2. Add attachment "stdarg.patch" [3f1569dad4] (rid 121389) by dgp on 2001-04-28 12:31:19.

  3. Ticket change [c93e5ded92] (rid 122247) by dgp on 2001-04-28 12:31:19:

    1. icomment:
      
      
      File Added - 5805: stdarg.patch
      
      Logged In: YES 
      user_id=80530
      
      This report accurately describes standard C++.  In fact,
      in our own C++ code that embeds the Tcl library, we
      always include tcl.h like so:
      
      #ifdef __cplusplus
      extern "C" {
      #  ifndef HAS_STDARG
      #    define HAS_STDARG
      #  endif
      #endif
      
      #include <tcl.h>
      
      #ifdef __cplusplus
      }// end of extern "C"
      #endif
      
      However, Tcl has a history of supporting lots of
      nonstandard compilers.  Lines 206-208 of tcl.h
      indicate that at least at one time it was useful
      to support a compiler that defined __cplusplus,
      but preferred <varargs.h> to <stdarg.h>.
      
      Unfortunately those lines date back to the pre-CVS
      days of Tcl, so I can't retrieve any CVS history that
      explains their purpose.
      
      I have no objection to the request, but I would like
      to understand the purpose of lines 206-208 before we
      (effectively) yank them out.
      
      In case we decide to go ahead with this, I attach the
      patch.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. subsystem changed to: "69. Other"
    5. username: "dgp"
  4. Ticket change [95a5737cc2] (rid 106192) by hobbs on 2001-05-04 03:45:16:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      The submitter doesn't make an argument as to why C++ should 
      always include stdarg.h and not varargs.h.  Is that also in 
      the C++ standard now?  If so, then apply the patch, 
      otherwise it seems like HAS_STDARG should somehow get 
      defined at the appropriate step (perhaps in configure).
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  5. Ticket change [dab2df0236] (rid 107837) by dgp on 2001-05-04 04:17:40:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Well, the C++ standard has moved on.  The standard
      thing to do in C++ is:
      
      #include <cstdarg>
      
      but that's not C-compatible, so we won't be doing that.
      
      The problem with relying on configure to sort things out
      is that the header file tcl.h is included in the compiling
      of other C/C++ programs that link the Tcl library.  These
      other programs may or may not be using autoconf to manage
      their Makefiles, etc.
      
      In that case, though, it seems the advice to pass back
      to the submitter is that he/she should add -DHAS_STDARG
      in the approprate place(s) in his/her build system.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [efb0d537af] (rid 109042) by jenglish on 2002-06-22 04:43:52:

    1. closedate changed to: "2002-06-21T21:43:52"
    2. closer changed to: "jenglish"
    3. icomment:
      Logged In: YES 
      user_id=68433
      
      This should be fixed now (generic/tcl.h r1.126).  The new
      logic is:
      
      #if !defined(NO_STDARG)
      #   include <stdarg.h>
          /* ... */
      #else
      #  include <varargs.h>
      #endif
      
      where NO_STDARG  is undefined by default.   This should
      keep  C++ compilers happy as long as they're relatively
      recent (post-1990 or so).
      
      
    4. login: "jenglish"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. subsystem changed to: "52. Portability Support"
    8. username: "jenglish"