Tcl Source Code

Changes On Branch tip-512
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch tip-512 Excluding Merge-Ins

This is equivalent to a diff from 1e3b9149a7 to a6c095ea63

2018-11-15
07:51
Implement TIP #512: No stub for Tcl_SetExitProc() check-in: ea0975d6d3 user: jan.nijtmans tags: core-8-branch
2018-11-13
15:23
Plug memory leak. Fork new trunk that isn't broken. check-in: b512b07904 user: dgp tags: trunk
2018-11-06
09:50
Implement TIP 406 check-in: 5f51fd5a97 user: dkf tags: core-8-branch
09:49
merge core-8-branch Closed-Leaf check-in: 9484e75bad user: dkf tags: dkf-http-cookies
2018-11-04
15:34
Start of implementing TIP 480. check-in: 3d83a8577a user: dkf tags: tip-480
2018-11-02
17:18
Fixed memory leak in TclOO.c:ObjectNamespaceDeleted, object mixins and object/class mutation. check-in: 2b48a5d43c user: dgp tags: rc2, core-8-6-9-rc
07:26
Merge 8.7 Closed-Leaf check-in: a6c095ea63 user: jan.nijtmans tags: tip-512
2018-11-01
20:10
Fixed memory leak in TclOO.c:ObjectNamespaceDeleted, object mixins and object/class mutation. check-in: 1e3b9149a7 user: pooryorick tags: core-8-branch
14:48
Eliminate fallback attempts when broken strtod() routines are detected. This has long been creating ... check-in: eaf2699f09 user: dgp tags: core-8-branch
2018-10-23
19:39
Merge 8.7 check-in: b4db93bcfb user: jan.nijtmans tags: tip-512

Changes to generic/tcl.decls.

   509    509   }
   510    510   declare 142 {
   511    511       int Tcl_ExprString(Tcl_Interp *interp, const char *expr)
   512    512   }
   513    513   declare 143 {
   514    514       void Tcl_Finalize(void)
   515    515   }
   516         -declare 144 {
          516  +declare 144 {nostub {Don't use this function in a stub-enabled extension}} {
   517    517       void Tcl_FindExecutable(const char *argv0)
   518    518   }
   519    519   declare 145 {
   520    520       Tcl_HashEntry *Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
   521    521   	    Tcl_HashSearch *searchPtr)
   522    522   }
   523    523   declare 146 {
................................................................................
   808    808   }
   809    809   declare 228 {
   810    810       void Tcl_SetErrorCode(Tcl_Interp *interp, ...)
   811    811   }
   812    812   declare 229 {
   813    813       void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
   814    814   }
   815         -declare 230 {
          815  +declare 230 {nostub {Don't use this function in a stub-enabled extension}} {
   816    816       void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
   817    817   }
   818    818   declare 231 {
   819    819       int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth)
   820    820   }
   821    821   declare 232 {
   822    822       void Tcl_SetResult(Tcl_Interp *interp, char *result,
................................................................................
   855    855       int Tcl_SplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr,
   856    856   	    const char ***argvPtr)
   857    857   }
   858    858   # Obsolete, use Tcl_FSSplitPath
   859    859   declare 243 {
   860    860       void Tcl_SplitPath(const char *path, int *argcPtr, const char ***argvPtr)
   861    861   }
   862         -declare 244 {
          862  +declare 244 {nostub {Don't use this function in a stub-enabled extension}} {
   863    863       void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName,
   864    864   	    Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc)
   865    865   }
   866    866   declare 245 {
   867    867       int Tcl_StringMatch(const char *str, const char *pattern)
   868    868   }
   869    869   declare 246 {deprecated {}} {
................................................................................
  1864   1864   # TIP#137 (encoding-aware source command) dgp for Anton Kovalenko
  1865   1865   declare 518 {
  1866   1866       int Tcl_FSEvalFileEx(Tcl_Interp *interp, Tcl_Obj *fileName,
  1867   1867   	    const char *encodingName)
  1868   1868   }
  1869   1869   
  1870   1870   # TIP#121 (exit handler) dkf for Joe Mistachkin
  1871         -declare 519 {
         1871  +declare 519 {nostub {Don't use this function in a stub-enabled extension}} {
  1872   1872       Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
  1873   1873   }
  1874   1874   
  1875   1875   # TIP#143 (resource limits) dkf
  1876   1876   declare 520 {
  1877   1877       void Tcl_LimitAddHandler(Tcl_Interp *interp, int type,
  1878   1878   	    Tcl_LimitHandlerProc *handlerProc, ClientData clientData,

Changes to generic/tcl.h.

  2399   2399   
  2400   2400   /*
  2401   2401    * Public functions that are not accessible via the stubs table.
  2402   2402    * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
  2403   2403    */
  2404   2404   
  2405   2405   #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
  2406         -	    (((Tcl_SetPanicProc)(Tcl_ConsolePanic), Tcl_CreateInterp)()))
         2406  +	    ((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp)()))
  2407   2407   EXTERN void		Tcl_MainEx(int argc, char **argv,
  2408   2408   			    Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
  2409   2409   EXTERN const char *	Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
  2410   2410   			    const char *version, int exact);
  2411   2411   EXTERN void		Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
  2412   2412   #ifndef _WIN32
  2413   2413   EXTERN int		TclZipfs_AppHook(int *argc, char ***argv);

Changes to generic/tclDecls.h.

  2042   2042       int (*tcl_ExprDouble) (Tcl_Interp *interp, const char *expr, double *ptr); /* 137 */
  2043   2043       int (*tcl_ExprDoubleObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, double *ptr); /* 138 */
  2044   2044       int (*tcl_ExprLong) (Tcl_Interp *interp, const char *expr, long *ptr); /* 139 */
  2045   2045       int (*tcl_ExprLongObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, long *ptr); /* 140 */
  2046   2046       int (*tcl_ExprObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr); /* 141 */
  2047   2047       int (*tcl_ExprString) (Tcl_Interp *interp, const char *expr); /* 142 */
  2048   2048       void (*tcl_Finalize) (void); /* 143 */
  2049         -    void (*tcl_FindExecutable) (const char *argv0); /* 144 */
         2049  +    TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
  2050   2050       Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
  2051   2051       int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
  2052   2052       void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
  2053   2053       int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
  2054   2054       int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
  2055   2055       ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
  2056   2056       Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */
................................................................................
  2136   2136       void (*tcl_SetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 223 */
  2137   2137       void (*tcl_SetChannelBufferSize) (Tcl_Channel chan, int sz); /* 224 */
  2138   2138       int (*tcl_SetChannelOption) (Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, const char *newValue); /* 225 */
  2139   2139       int (*tcl_SetCommandInfo) (Tcl_Interp *interp, const char *cmdName, const Tcl_CmdInfo *infoPtr); /* 226 */
  2140   2140       void (*tcl_SetErrno) (int err); /* 227 */
  2141   2141       void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
  2142   2142       void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
  2143         -    void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
         2143  +    TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
  2144   2144       int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */
  2145   2145       void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
  2146   2146       int (*tcl_SetServiceMode) (int mode); /* 233 */
  2147   2147       void (*tcl_SetObjErrorCode) (Tcl_Interp *interp, Tcl_Obj *errorObjPtr); /* 234 */
  2148   2148       void (*tcl_SetObjResult) (Tcl_Interp *interp, Tcl_Obj *resultObjPtr); /* 235 */
  2149   2149       void (*tcl_SetStdChannel) (Tcl_Channel channel, int type); /* 236 */
  2150   2150       TCL_DEPRECATED_API("No longer in use, changed to macro") const char * (*tcl_SetVar) (Tcl_Interp *interp, const char *varName, const char *newValue, int flags); /* 237 */
  2151   2151       const char * (*tcl_SetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags); /* 238 */
  2152   2152       const char * (*tcl_SignalId) (int sig); /* 239 */
  2153   2153       const char * (*tcl_SignalMsg) (int sig); /* 240 */
  2154   2154       void (*tcl_SourceRCFile) (Tcl_Interp *interp); /* 241 */
  2155   2155       int (*tcl_SplitList) (Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr); /* 242 */
  2156   2156       void (*tcl_SplitPath) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */
  2157         -    void (*tcl_StaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 244 */
         2157  +    TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_StaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 244 */
  2158   2158       int (*tcl_StringMatch) (const char *str, const char *pattern); /* 245 */
  2159   2159       TCL_DEPRECATED_API("") int (*tcl_TellOld) (Tcl_Channel chan); /* 246 */
  2160   2160       TCL_DEPRECATED_API("No longer in use, changed to macro") int (*tcl_TraceVar) (Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 247 */
  2161   2161       int (*tcl_TraceVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 248 */
  2162   2162       char * (*tcl_TranslateFileName) (Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr); /* 249 */
  2163   2163       int (*tcl_Ungets) (Tcl_Channel chan, const char *str, int len, int atHead); /* 250 */
  2164   2164       void (*tcl_UnlinkVar) (Tcl_Interp *interp, const char *varName); /* 251 */
................................................................................
  2425   2425       Tcl_Namespace * (*tcl_GetCurrentNamespace) (Tcl_Interp *interp); /* 512 */
  2426   2426       Tcl_Namespace * (*tcl_GetGlobalNamespace) (Tcl_Interp *interp); /* 513 */
  2427   2427       Tcl_Namespace * (*tcl_FindNamespace) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 514 */
  2428   2428       Tcl_Command (*tcl_FindCommand) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 515 */
  2429   2429       Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */
  2430   2430       void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */
  2431   2431       int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */
  2432         -    Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
         2432  +    TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
  2433   2433       void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */
  2434   2434       void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */
  2435   2435       int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
  2436   2436       int (*tcl_LimitCheck) (Tcl_Interp *interp); /* 523 */
  2437   2437       int (*tcl_LimitExceeded) (Tcl_Interp *interp); /* 524 */
  2438   2438       void (*tcl_LimitSetCommands) (Tcl_Interp *interp, int commandLimit); /* 525 */
  2439   2439       void (*tcl_LimitSetTime) (Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 526 */
................................................................................
  3855   3855   
  3856   3856   #if defined(USE_TCL_STUBS)
  3857   3857   #   undef Tcl_CreateInterp
  3858   3858   #   undef Tcl_FindExecutable
  3859   3859   #   undef Tcl_GetStringResult
  3860   3860   #   undef Tcl_Init
  3861   3861   #   undef Tcl_SetPanicProc
         3862  +#   undef Tcl_SetExitProc
  3862   3863   #   undef Tcl_ObjSetVar2
  3863   3864   #   undef Tcl_StaticPackage
  3864   3865   #   define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp())
  3865   3866   #   define Tcl_GetStringResult(interp) (tclStubsPtr->tcl_GetStringResult(interp))
  3866   3867   #   define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp))
  3867         -#   define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc))
  3868   3868   #   define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \
  3869   3869   	    (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags))
  3870   3870   #endif
  3871   3871   
  3872   3872   #if defined(_WIN32) && defined(UNICODE)
  3873   3873   #   define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
  3874   3874   #   define Tcl_MainEx Tcl_MainExW

Changes to generic/tclPanic.c.

    41     41    *
    42     42    * Side effects:
    43     43    *	Sets the panicProc variable.
    44     44    *
    45     45    *----------------------------------------------------------------------
    46     46    */
    47     47   
    48         -#undef Tcl_SetPanicProc
    49     48   void
    50     49   Tcl_SetPanicProc(
    51     50       TCL_NORETURN1 Tcl_PanicProc *proc)
    52     51   {
    53     52   #if defined(_WIN32)
    54     53       /* tclWinDebugPanic only installs if there is no panicProc yet. */
    55     54       if ((proc != tclWinDebugPanic) || (panicProc == NULL))
    56     55   #elif defined(__CYGWIN__)
    57     56       if (proc == NULL)
    58     57   	panicProc = tclWinDebugPanic;
    59     58       else
    60     59   #endif
    61     60       panicProc = proc;
           61  +    TclInitSubsystems();
    62     62   }
    63     63   
    64     64   /*
    65     65    *----------------------------------------------------------------------
    66     66    *
    67     67    * Tcl_PanicVA --
    68     68    *

Changes to generic/tclStubInit.c.

    41     41   #undef Tcl_GetUnicode
    42     42   #undef Tcl_DumpActiveMemory
    43     43   #undef Tcl_ValidateAllMemory
    44     44   #undef Tcl_FindHashEntry
    45     45   #undef Tcl_CreateHashEntry
    46     46   #undef Tcl_Panic
    47     47   #undef Tcl_FindExecutable
           48  +#undef Tcl_SetExitProc
    48     49   #undef Tcl_SetPanicProc
    49     50   #undef TclpGetPid
    50     51   #undef TclSockMinimumBuffers
    51     52   #undef Tcl_SetIntObj
    52     53   #undef Tcl_SetLongObj
    53     54   #undef TclpInetNtoa
    54     55   #undef TclWinGetServByName
................................................................................
   392    393   #   define TclpGetDate 0
   393    394   #   undef TclpLocaltime
   394    395   #   define TclpLocaltime 0
   395    396   #   undef TclpGmtime
   396    397   #   define TclpGmtime 0
   397    398   #   define TclpLocaltime_unix 0
   398    399   #   define TclpGmtime_unix 0
          400  +#   define Tcl_SetExitProc 0
          401  +#   define Tcl_SetPanicProc 0
          402  +#   define Tcl_FindExecutable 0
   399    403   #   define Tcl_GetUnicode 0
   400    404   #else /* TCL_NO_DEPRECATED */
   401    405   #   define Tcl_SeekOld seekOld
   402    406   #   define Tcl_TellOld tellOld
   403    407   #   define TclBackgroundException Tcl_BackgroundException
   404    408   #   define TclSetStartupScript Tcl_SetStartupScript
   405    409   #   define TclGetStartupScript Tcl_GetStartupScript

Changes to generic/tclTest.c.

   439    439   			    Tcl_Interp *interp, int objc,
   440    440   			    Tcl_Obj *const objv[]);
   441    441   #if defined(HAVE_CPUID) || defined(_WIN32)
   442    442   static int		TestcpuidCmd(ClientData dummy,
   443    443   			    Tcl_Interp* interp, int objc,
   444    444   			    Tcl_Obj *const objv[]);
   445    445   #endif
          446  +
          447  +#ifdef __GNUC__
          448  +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
          449  +#endif
   446    450   
   447    451   static const Tcl_Filesystem testReportingFilesystem = {
   448    452       "reporting",
   449    453       sizeof(Tcl_Filesystem),
   450    454       TCL_FILESYSTEM_VERSION_1,
   451    455       TestReportInFilesystem, /* path in */
   452    456       TestReportDupInternalRep,