Artifacts Associated With Ticket 419692ffffffffffffffffffffffffffffffffff
Ticket change [1701e4cf98] (rid 124809) by nobody on 2001-04-28 03:52:54:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "52. Portability Support"
- title initialized to: "c++ & tcl.h inclusion of varargs.h"
- type initialized to: "Bug"
Add attachment "stdarg.patch" [3f1569dad4] (rid 121389) by dgp on 2001-04-28 12:31:19.
Ticket change [c93e5ded92] (rid 122247) by dgp on 2001-04-28 12:31:19:
- 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. - login: "dgp"
- mimetype: "text/plain"
- subsystem changed to: "69. Other"
- username: "dgp"
- icomment:
Ticket change [95a5737cc2] (rid 106192) by hobbs on 2001-05-04 03:45:16:
- 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).
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [dab2df0236] (rid 107837) by dgp on 2001-05-04 04:17:40:
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [efb0d537af] (rid 109042) by jenglish on 2002-06-22 04:43:52:
- closedate changed to: "2002-06-21T21:43:52"
- closer changed to: "jenglish"
- 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). - login: "jenglish"
- mimetype: "text/plain"
- status changed to: "Closed"
- subsystem changed to: "52. Portability Support"
- username: "jenglish"